Package com.im.df.api.ddl
Interface DFDataTree.Vertex
-
- Enclosing interface:
- DFDataTree
public static interface DFDataTree.Vertex
The Vertex in data tree graph. Vertexes are connected by edges.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_EDGES
Fired when there was a change in edges incident to this vertex.static java.lang.String
PROP_VALID
Fired when validity of this vertex has changed.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DFDataTree.Edge
addEdge(DFRelationship.Direction relationshipDir, com.im.commons.progress.DFEnvironmentRW env)
Add new edge to some detail entity (starting at this vertex).void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Register listener to changes in this vertex.DFDataTree
getDataTree()
java.util.List<DFDataTree.Edge>
getEdges()
DFEntity
getEntity()
DFDataTree.Edge
getIncomingEdge()
boolean
isValid()
Get the status of this vertex.void
removeEdge(DFDataTree.Edge edge, com.im.commons.progress.DFEnvironmentRW env)
Remove the existing outgoing edge starting in this vertex.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregister listener to changes in this vertex.
-
-
-
Field Detail
-
PROP_EDGES
static final java.lang.String PROP_EDGES
Fired when there was a change in edges incident to this vertex. E.g. when new edge was added or removed.- See Also:
- Constant Field Values
-
PROP_VALID
static final java.lang.String PROP_VALID
Fired when validity of this vertex has changed.- See Also:
- Constant Field Values
-
-
Method Detail
-
getEntity
DFEntity getEntity()
- Returns:
- The entity which belongs to this vertex
-
getDataTree
DFDataTree getDataTree()
- Returns:
- The datatree which this vertex belongs to (just the link back to owner). Never
null
.
-
getIncomingEdge
DFDataTree.Edge getIncomingEdge()
- Returns:
- The edge going to this vertex from parent vertex. Returns
null
if the vertex is the root.
-
getEdges
java.util.List<DFDataTree.Edge> getEdges()
- Returns:
- all outgoing edges starting from this vertex. Never return
null
. If there is no edge, it just returns empty list.
-
addEdge
DFDataTree.Edge addEdge(DFRelationship.Direction relationshipDir, com.im.commons.progress.DFEnvironmentRW env)
Add new edge to some detail entity (starting at this vertex). New edge and its end vertex are both created. ChangeEvent is fired if the operation is successful.- Parameters:
relationshipDir
- The oriented relationship from this vertex' entity to some other entity. It's supposed that relationshipDir.getSrcField().getEntity() is the same entity as this.getEntity(). Otherwise this method fails and can throw an exception.env
- the environment- Returns:
- The newly created edge
-
removeEdge
void removeEdge(DFDataTree.Edge edge, com.im.commons.progress.DFEnvironmentRW env)
Remove the existing outgoing edge starting in this vertex. ChangeEvent is fired if the operation is successful.- Parameters:
env
- the environmentedge
- The edge to be removed.
-
isValid
boolean isValid()
Get the status of this vertex. Validity of vertexes is similar toDFItem.isValid()
method, because vertex is always created as valid when added to parent (or loaded). Once it become invalid, it never goes back to valid state. Vertex is invalidated when it is removed from its parent or when whole subtree of vertexes is removed fromDFDataTree
.- Returns:
- is this Vertex valid?
-
addPropertyChangeListener
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Register listener to changes in this vertex. Edges changes (add/remove) are fired through this listener, as well as validity of the vertex.- Parameters:
listener
- to be registered
-
removePropertyChangeListener
void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregister listener to changes in this vertex. Edges changes (add/remove) are fired through this listener, as well as validity of the vertex.- Parameters:
listener
- to be unregistered
-
-