## org.eclipse.emf.ecore.change.util
Class BasicChangeRecorder

    java.lang.Object
      org.eclipse.emf.ecore.change.util.ListDifferenceAnalyzer
          org.eclipse.emf.ecore.change.util.BasicChangeRecorder

Direct Known Subclasses:
  ChangeRecorder

    public class BasicChangeRecorder

extends ListDifferenceAnalyzer

This class provides the basic methods required to implement a change recorder.

Since:
  2.3

Field Summary
`protected ChangeDescription` `changeDescription`
`protected boolean` `recording`

Constructor Summary
`BasicChangeRecorder()`

Method Summary
`protected void` `consolidateChanges()` Consolidates the changes that have happen since the last consolidation.
`protected ChangeDescription` `createChangeDescription()`
`protected FeatureChange` `createFeatureChange(EObject eObject, EStructuralFeature eStructuralFeature, java.lang.Object value, boolean isSet)`
`protected ResourceChange` `createResourceChange(Resource resource, EList<java.lang.Object> value)`
`void` `dispose()` Disposes this change recorder.
`protected void` `eliminateEmptyChanges()` Eliminates changes that result in a state that's equal to the current state.
`ChangeDescription` `endRecording()` Ends the recording and consolidates the changes on the `change description`.
`protected void` `finalizeChange(FeatureChange change, EObject eObject)`
`protected void` `finalizeChange(ResourceChange change)`
`protected ChangeDescription` `getChangeDescription()`
`protected FeatureChange` `getFeatureChange(java.util.List<FeatureChange> featureChanges, EStructuralFeature eStructuralFeature)`
`protected java.util.List<FeatureChange>` `getFeatureChanges(EObject eObject)`
`protected ResourceChange` `getResourceChange(Resource resource)`
`protected EList<ResourceChange>` `getResourceChanges()`
`boolean` `isRecording()`
`protected void` `setChangeDescription(ChangeDescription changeDescription)`
`protected void` `setRecording(boolean recording)`
`protected boolean` `shouldRecord(EStructuralFeature feature, EObject eObject)`
`ChangeDescription` `summarize()` Summarizes the changes made to the analyzed objects on the `change description` returned by the `endRecording()` without ending the recording.

Methods inherited from class org.eclipse.emf.ecore.change.util.ListDifferenceAnalyzer
`analyzeLists, analyzeLists, createAddListChange, createListChange, createListChanges, createMoveListChange, createRemoveListChange`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### recording

    protected boolean recording

### changeDescription

    protected ChangeDescription changeDescription

Constructor Detail

### BasicChangeRecorder

    public BasicChangeRecorder()

Method Detail

### isRecording

    public boolean isRecording()

  Returns:
    true if this change recorder is recording or false otherwise.

### setRecording

    protected void setRecording(boolean recording)

### getChangeDescription

    protected ChangeDescription getChangeDescription()

### setChangeDescription

    protected void setChangeDescription(ChangeDescription changeDescription)

### dispose

    public void dispose()

  Disposes this change recorder. This method ends a recording without consolidating the changes.

### summarize

    public ChangeDescription summarize()

  Summarizes the changes made to the analyzed objects on the `change description` returned by the `endRecording()` without ending the recording.

  This method doesn't do anything if this ChangeRecorder is not recording.

  Returns:
    the `ChangeDescription` or `null` if there is nothing being recorded.

### endRecording

    public ChangeDescription endRecording()

  Ends the recording and consolidates the changes on the `change description`.

  Returns:
    the `ChangeDescription` or `null` if there is nothing being recorded.

### consolidateChanges

    protected void consolidateChanges()

  Consolidates the changes that have happen since the last consolidation.

### eliminateEmptyChanges

    protected void eliminateEmptyChanges()

  Eliminates changes that result in a state that's equal to the current state.

### shouldRecord

    protected boolean shouldRecord(EStructuralFeature feature,
                                   EObject eObject)

### finalizeChange

    protected void finalizeChange(ResourceChange change)

### finalizeChange

    protected void finalizeChange(FeatureChange change,
                                  EObject eObject)

### getResourceChanges

    protected EList<ResourceChange> getResourceChanges()

### getResourceChange

    protected ResourceChange getResourceChange(Resource resource)

### getFeatureChanges

    protected java.util.List<FeatureChange> getFeatureChanges(EObject eObject)

### getFeatureChange

    protected FeatureChange getFeatureChange(java.util.List<FeatureChange> featureChanges,
                                             EStructuralFeature eStructuralFeature)

### createFeatureChange

    protected FeatureChange createFeatureChange(EObject eObject,
                                                EStructuralFeature eStructuralFeature,
                                                java.lang.Object value,
                                                boolean isSet)

### createResourceChange

    protected ResourceChange createResourceChange(Resource resource,
                                                  EList<java.lang.Object> value)

### createChangeDescription

    protected ChangeDescription createChangeDescription()

Copyright 2001-2006 IBM Corporation and others. All Rights Reserved.