|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faktorips.runtime.internal.ModelObjectDelta
public class ModelObjectDelta
IModelObjectDelta implementation.
| Field Summary |
|---|
| Fields inherited from interface org.faktorips.runtime.IModelObjectDelta |
|---|
ADDED, CHANGED, CHILD_CHANGED, CLASS_CHANGED, DIFFERENT_OBJECT_AT_POSITION, EMPTY, MOVED, PROPERTY_CHANGED, REMOVED, STRUCTURE_CHANGED |
| Method Summary | |
|---|---|
void |
accept(IModelObjectDeltaVisitor visitor)
Accepts the given visitor. |
void |
addChildDelta(IModelObjectDelta childDelta)
Adds the child delta to this delta and sets this delta's kindOfChange accordingly. |
void |
checkPropertyChange(String property,
boolean value1,
boolean value2,
IDeltaComputationOptions options)
|
void |
checkPropertyChange(String property,
char value1,
char value2,
IDeltaComputationOptions options)
|
void |
checkPropertyChange(String property,
double value1,
double value2,
IDeltaComputationOptions options)
|
void |
checkPropertyChange(String property,
float value1,
float value2,
IDeltaComputationOptions options)
|
void |
checkPropertyChange(String property,
int value1,
int value2,
IDeltaComputationOptions options)
|
void |
checkPropertyChange(String property,
Object value1,
Object value2,
IDeltaComputationOptions options)
|
static void |
createChildDeltas(ModelObjectDelta delta,
IModelObject original,
IModelObject refObject,
String association,
IDeltaComputationOptions options)
|
static void |
createChildDeltas(ModelObjectDelta delta,
List<? extends IModelObject> originals,
List<? extends IModelObject> refObjects,
String association,
IDeltaComputationOptions options)
|
String |
getAssociation()
The name of the association to that the object has been added / has been removed from or is moved in. |
List<String> |
getChangedProperties()
Returns the properties that have a different a value in the model object and the reference model object. |
List<IModelObjectDelta> |
getChildDeltas()
Returns deltas for all children of the model object which were added, removed, or changed. |
List<IModelObjectDelta> |
getChildDeltas(int kind)
Returns deltas for all children of this model object whose kind is included in the given mask. |
int |
getKind()
Returns the kind of change. |
int |
getKindOfChange()
If delta's kind is IModelObjectDelta.CHANGED, this method returns the kind of changed defined by the
constant listed below. |
IModelObject |
getOriginalObject()
The model object this delta is computed for. |
IModelObject |
getReferenceObject()
The model object that is taken as a reference to which the orginal model object is compared to. |
boolean |
isAdded()
Returns true if this model object has been added to its parent,
false otherwise. |
boolean |
isChanged()
Returns true if this model object has been changed. |
boolean |
isChildChanged()
Returns true if at least one model object's children has been changed. |
boolean |
isClassChanged()
Returns true if the model object's Java class has "changed". |
boolean |
isDifferentObjectAtPosition()
Returns true if a different model object is at a position, otherwise
false. |
boolean |
isEmpty()
Returns true if the delta is empty, the two objects are the same, otherwise
false. |
boolean |
isMoved()
Returns true if this model object has changed its position in the ordered
association. |
boolean |
isPropertyChanged()
Returns true if at least one the model object's properties has changed,
otherwise false. |
boolean |
isPropertyChanged(String propertyName)
Returns true if the model object contains a different value for the given
property than then reference model object. |
boolean |
isRemoved()
Returns true if this model object has been removed from its parent,
false otherwise. |
boolean |
isStructureChanged()
Returns true if this model object's structure has changed. |
void |
markMoved()
Marks the delta as one where the object has changed its position. |
void |
markPropertyChanged(String property)
Marks the given property as having a different value in the model object and the reference model object. |
static ModelObjectDelta |
newAddDelta(IModelObject addedObject,
String association,
IDeltaComputationOptions options)
|
static ModelObjectDelta |
newChangeDelta(IModelObject original,
IModelObject refObject,
int kindOfChange)
|
static ModelObjectDelta |
newDelta(IModelObject object,
IModelObject refObject,
IDeltaComputationOptions options)
|
static ModelObjectDelta |
newDifferentObjectAtPositionChangedDelta(IModelObject original,
IModelObject refObject,
String association)
|
static ModelObjectDelta |
newEmptyDelta(IModelObject object,
IModelObject refObject)
|
static ModelObjectDelta |
newRemoveDelta(IModelObject removedObject,
String association,
IDeltaComputationOptions options)
|
String |
toString()
|
void |
toString(StringBuffer buffer,
String indentation)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static final ModelObjectDelta newDelta(IModelObject object,
IModelObject refObject,
IDeltaComputationOptions options)
public static final ModelObjectDelta newEmptyDelta(IModelObject object,
IModelObject refObject)
public static final void createChildDeltas(ModelObjectDelta delta,
IModelObject original,
IModelObject refObject,
String association,
IDeltaComputationOptions options)
public static final void createChildDeltas(ModelObjectDelta delta,
List<? extends IModelObject> originals,
List<? extends IModelObject> refObjects,
String association,
IDeltaComputationOptions options)
public static final ModelObjectDelta newAddDelta(IModelObject addedObject,
String association,
IDeltaComputationOptions options)
public static final ModelObjectDelta newRemoveDelta(IModelObject removedObject,
String association,
IDeltaComputationOptions options)
public static final ModelObjectDelta newDifferentObjectAtPositionChangedDelta(IModelObject original,
IModelObject refObject,
String association)
public static final ModelObjectDelta newChangeDelta(IModelObject original,
IModelObject refObject,
int kindOfChange)
public void addChildDelta(IModelObjectDelta childDelta)
Note this method ignores the childDelta if it is null or empty!!!
public IModelObject getOriginalObject()
IModelObjectDeltanull.
getOriginalObject in interface IModelObjectDeltapublic IModelObject getReferenceObject()
IModelObjectDelta
If this is a delta for a a child that was removed from the orginial model object, the method
returns null.
getReferenceObject in interface IModelObjectDeltapublic int getKind()
IModelObjectDelta
getKind in interface IModelObjectDeltaIModelObjectDelta.EMPTY,
IModelObjectDelta.ADDED,
IModelObjectDelta.REMOVED,
IModelObjectDelta.MOVED,
IModelObjectDelta.DIFFERENT_OBJECT_AT_POSITION,
IModelObjectDelta.CHANGEDpublic int getKindOfChange()
IModelObjectDeltaIModelObjectDelta.CHANGED, this method returns the kind of changed defined by the
constant listed below. Not that the kind of changes are not mututally excluded, so the
returned kinds are bit masked. The method returns 0, if the delta's kind is not
IModelObjectDelta.CHANGED.
getKindOfChange in interface IModelObjectDeltaIModelObjectDelta.PROPERTY_CHANGED,
IModelObjectDelta.STRUCTURE_CHANGED,
IModelObjectDelta.CHILD_CHANGEDpublic String getAssociation()
IModelObjectDelta
getAssociation in interface IModelObjectDelta
public void checkPropertyChange(String property,
Object value1,
Object value2,
IDeltaComputationOptions options)
public void checkPropertyChange(String property,
int value1,
int value2,
IDeltaComputationOptions options)
public void checkPropertyChange(String property,
boolean value1,
boolean value2,
IDeltaComputationOptions options)
public void checkPropertyChange(String property,
double value1,
double value2,
IDeltaComputationOptions options)
public void checkPropertyChange(String property,
float value1,
float value2,
IDeltaComputationOptions options)
public void checkPropertyChange(String property,
char value1,
char value2,
IDeltaComputationOptions options)
public void markPropertyChanged(String property)
public boolean isClassChanged()
IModelObjectDeltatrue if the model object's Java class has "changed". (Technically its of
course just an instance of another class). Returns false otherwise.
isClassChanged in interface IModelObjectDeltapublic boolean isPropertyChanged()
IModelObjectDeltatrue if at least one the model object's properties has changed,
otherwise false.
isPropertyChanged in interface IModelObjectDeltapublic List<String> getChangedProperties()
IModelObjectDelta
getChangedProperties in interface IModelObjectDeltapublic boolean isPropertyChanged(String propertyName)
IModelObjectDeltatrue if the model object contains a different value for the given
property than then reference model object. Returns false otherwise. Returns
false if propertyName is null.
isPropertyChanged in interface IModelObjectDeltapublic void markMoved()
public boolean isMoved()
IModelObjectDeltatrue if this model object has changed its position in the ordered
association. This type of delta is only returned if the computation method is
IDeltaComputationOptions.ComputationMethod.BY_OBJECT.
isMoved in interface IModelObjectDeltapublic boolean isDifferentObjectAtPosition()
IModelObjectDeltatrue if a different model object is at a position, otherwise
false. This type of delta is only returned if the computation method is
IDeltaComputationOptions.ComputationMethod.BY_POSITION.
isDifferentObjectAtPosition in interface IModelObjectDeltapublic boolean isAdded()
IModelObjectDeltatrue if this model object has been added to its parent,
false otherwise.
isAdded in interface IModelObjectDeltapublic boolean isChanged()
IModelObjectDeltatrue if this model object has been changed.
isChanged in interface IModelObjectDeltapublic boolean isChildChanged()
IModelObjectDeltatrue if at least one model object's children has been changed.
isChildChanged in interface IModelObjectDeltapublic boolean isEmpty()
IModelObjectDeltatrue if the delta is empty, the two objects are the same, otherwise
false.
isEmpty in interface IModelObjectDeltapublic boolean isRemoved()
IModelObjectDeltatrue if this model object has been removed from its parent,
false otherwise.
isRemoved in interface IModelObjectDeltapublic boolean isStructureChanged()
IModelObjectDeltatrue if this model object's structure has changed. That means either a
child has been added or removed or a child has been been moved.
isStructureChanged in interface IModelObjectDeltapublic List<IModelObjectDelta> getChildDeltas()
IModelObjectDelta
getChildDeltas in interface IModelObjectDeltapublic List<IModelObjectDelta> getChildDeltas(int kind)
IModelObjectDeltaIModelObjectDelta kind
constants. Returns an empty array if there are no affected children.
getChildDeltas in interface IModelObjectDeltapublic void accept(IModelObjectDeltaVisitor visitor)
IModelObjectDelta
The visitor's visit method is called. If the visitor returns true,
the delta's children are also visited.
accept in interface IModelObjectDeltavisitor - the visitorIModelObjectDeltaVisitor.visit(IModelObjectDelta)public String toString()
toString in class Object
public void toString(StringBuffer buffer,
String indentation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||