com.im.df.api 5.9

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
static String PROP_EDGES
           
static String PROP_VALID
           
 
Method Summary
 DFDataTree.Edge addEdge(DFRelationship.Direction relationshipDir, DFEnvironmentRW env)
          Add new edge to some detail entity (starting at this vertex).
 void addPropertyChangeListener(PropertyChangeListener listener)
          Register listener to changes in this vertex.
 DFDataTree getDataTree()
           
 List<DFDataTree.Edge> getEdges()
          Return all children edges starting from this vertex.
 DFEntity getEntity()
           
 DFDataTree.Edge getIncomingEdge()
           
 boolean isValid()
          Get the status of this vertex.
 void removeEdge(DFDataTree.Edge edge, DFEnvironmentRW env)
          Remove the existing edge starting in this vertex.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Unregister listener to changes in this vertex.
 

Field Detail

PROP_EDGES

static final String PROP_EDGES
See Also:
Constant Field Values

PROP_VALID

static final String PROP_VALID
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 return null.

getIncomingEdge

DFDataTree.Edge getIncomingEdge()
Returns:
The edge going to this vertex from master (parent) vertex. Returns null if the vertex is the root.

getEdges

List<DFDataTree.Edge> getEdges()
Return all children 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,
                        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.
Returns:
The newly created edge

removeEdge

void removeEdge(DFDataTree.Edge edge,
                DFEnvironmentRW env)
Remove the existing edge starting in this vertex. ChangeEvent is fired if the operation is successful.

Parameters:
edge - The edge to be removed.

isValid

boolean isValid()
Get the status of this vertex. Validity of vertexes is similar to DFItem.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 from DFDataTree.


addPropertyChangeListener

void addPropertyChangeListener(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.


removePropertyChangeListener

void removePropertyChangeListener(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.


com.im.df.api 5.9