public interface ILcdEditableGraph<N,E> extends ILcdGraph<N,E>
ILcdEditableGraph
is a graph to which nodes and edges can be added or removed.Modifier and Type | Method and Description |
---|---|
void |
addEdge(E aEdge,
N aStartNode,
N aEndNode,
int aFireEventMode)
Adds an edge to this graph, connecting the two given nodes.
|
void |
addNode(N aNode,
int aFireEventMode)
Adds a node to this graph.
|
boolean |
canAddEdge(E aEdge,
N aStartNode,
N aEndNode)
Returns
true if the given edge can be added to this graph,
false otherwise. |
boolean |
canAddNode(N aNode)
Returns
true if the given node can be added to this graph,
false otherwise. |
boolean |
canRemoveEdge(E aEdge)
Returns
true if the given edge can be removed from this graph,
false otherwise. |
boolean |
canRemoveNode(N aNode)
Returns
true if the given node can be removed from this graph,
false otherwise. |
void |
clear(int aFireEventMode)
Clears the graph; all edges and nodes are removed.
|
void |
edgeChanged(E aEdge,
int aEventMode)
This method should be called when the given edge has changed.
|
void |
edgesChanged(Vector<E> aEdges,
int aEventMode)
This method should be called when the given edges have changed.
|
void |
fireCollectedGraphChanges()
Fires all the collected graph changes, i.e., all graph events that have been
generated using the the ILcdFireEventMode.FIRE_LATER mode, after the
previous call to
fireCollectedGraphChanges() . |
void |
nodeChanged(N aNode,
int aEventMode)
This method should be called when the given node has changed.
|
void |
nodesChanged(Vector<N> aNodes,
int aEventMode)
This method should be called when the given nodes have changed.
|
E |
removeEdge(E aEdge,
int aFireEventMode)
Removes an edge from this graph.
|
void |
removeEdges(int aFireEventMode)
Removes all edges from this graph - nodes will remain in the graph.
|
N |
removeNode(N aNode,
int aFireEventMode)
Removes a node from this graph.
|
addGraphListener, containsEdge, containsNode, getEdges, getEdges, getEndNode, getNodes, getOppositeNode, getStartNode, isConnected, removeGraphListener
boolean canAddNode(N aNode)
true
if the given node can be added to this graph,
false
otherwise. More specifically, a node can be added to this
graph if the following conditions are met:
null
aNode
- the node to be verified.true
if the node can be added to this graph,
false
otherwise.void addNode(N aNode, int aFireEventMode)
aNode
- the node to be added to this graph.aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
canAddNode(aNode)
-
Note: this validation is potentially expensive, and should be avoided
whenever possible.boolean canAddEdge(E aEdge, N aStartNode, N aEndNode)
true
if the given edge can be added to this graph,
false
otherwise. More specifically, an edge can be added to
this graph if the following conditions are met:
null
aEdge
- the edge to be verified.aStartNode
- the first node that should be connected by the given edge.aEndNode
- the second node that should be connected by the given edge.true
if the edge can be added to this graph,
false
otherwise.void addEdge(E aEdge, N aStartNode, N aEndNode, int aFireEventMode)
aEdge
- the edge to be added to this graph.aStartNode
- the first node that should be connected by the given edge.aEndNode
- the second node that should be connected by the given edge.aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
canAddEdge(aEdge, aStartNode, aEndNode)
-
Note: this validation is potentially expensive, and should be avoided
whenever possible.boolean canRemoveNode(N aNode)
true
if the given node can be removed from this graph,
false
otherwise. More specifically, a node can be remove from
this graph if the following conditions are met:
null
aNode
- the node to be verified.true
if the node can be removed from this graph,
false
otherwise.N removeNode(N aNode, int aFireEventMode)
aNode
- the node to be removed from this graph.aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
canRemoveNode(aNode)
-
Note: this validation is potentially expensive, and should be avoided
whenever possible.boolean canRemoveEdge(E aEdge)
true
if the given edge can be removed from this graph,
false
otherwise. More specifically, a edge can be remove from
this graph if the following conditions are met:
null
aEdge
- the edge to be verified.true
if the edge can be removed from this graph,
false
otherwise.E removeEdge(E aEdge, int aFireEventMode)
aEdge
- the edge to be removed from this graph.aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
canRemoveEdge(aEdge)
-
Note: this validation is potentially expensive, and should be avoided
whenever possible.void removeEdges(int aFireEventMode)
aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.void clear(int aFireEventMode)
aFireEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.void fireCollectedGraphChanges()
fireCollectedGraphChanges()
.
Note that a fireCollectedGraphChanges()
call is made whenever
a graph event is generated in the ILcdFireEventMode.FIRE_NOW
,
to guarantee the correct order of the events.void nodeChanged(N aNode, int aEventMode)
containsPartition(aNode)
-
Note: this validation is potentially expensive, and should be avoided
whenever possible.aNode
- the node that has changed.aEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.void nodesChanged(Vector<N> aNodes, int aEventMode)
aNodes
- a vector containing the nodes that have changed.aEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
node
object in the given vector should hold that:
containsPartition(node)
-
Note: this validation is potentially expensive, and should be avoided
whenever possible.void edgeChanged(E aEdge, int aEventMode)
aEdge
- the edge that has changed.aEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
containsBoundaryEdge(aEdge)
-
Note: this validation is potentially expensive, and should be avoided
whenever possible.void edgesChanged(Vector<E> aEdges, int aEventMode)
aEdges
- a vector containing the edges that have changed.aEventMode
- the mode for sending out the TLcdGraphChangedEvent. This
can be one of ILcdFireEventMode.FIRE_NOW,
ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT
.
edge
object in the given vector should hold that:
containsBoundaryEdge(edge)
-
Note: this validation is potentially expensive, and should be avoided
whenever possible.