Package org.apache.cayenne.graph
Class NodeDiff
java.lang.Object
org.apache.cayenne.graph.NodeDiff
- All Implemented Interfaces:
Serializable
,Comparable<NodeDiff>
,GraphDiff
- Direct Known Subclasses:
ArcCreateOperation
,ArcDeleteOperation
,NodeCreateOperation
,NodeDeleteOperation
,NodeIdChangeOperation
,NodePropertyChangeOperation
,ObjectDiff
An abstract superclass of operations on individual nodes and arcs in a
digraph.
- Since:
- 1.2
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
apply
(GraphChangeHandler tracker) Calls appropriate methods on the handler to "replay" this change.int
Implements a Comparable interface method to compare based on diffId property.int
Returns an id of this diff that can be used for various purposes, such as identifying the order of the diff in a sequence.boolean
isNoop()
Returns true if this diff is simply a placeholder and does not perform any actual operation.void
setDiffId
(int diffId) Sets an id of this diff that can be used for various purposes, such as identifying the order of the diff in a sequence.abstract void
undo
(GraphChangeHandler tracker) Calls appropriate methods on the handler to revert this change.
-
Field Details
-
diffId
protected int diffId -
nodeId
-
-
Constructor Details
-
NodeDiff
-
NodeDiff
-
-
Method Details
-
isNoop
public boolean isNoop()Description copied from interface:GraphDiff
Returns true if this diff is simply a placeholder and does not perform any actual operation. -
apply
Description copied from interface:GraphDiff
Calls appropriate methods on the handler to "replay" this change. -
undo
Description copied from interface:GraphDiff
Calls appropriate methods on the handler to revert this change. -
getNodeId
-
getDiffId
public int getDiffId()Returns an id of this diff that can be used for various purposes, such as identifying the order of the diff in a sequence. -
setDiffId
public void setDiffId(int diffId) Sets an id of this diff that can be used for various purposes, such as identifying the order of the diff in a sequence. -
compareTo
Implements a Comparable interface method to compare based on diffId property.- Specified by:
compareTo
in interfaceComparable<NodeDiff>
-