Class TLcdLimitedEditablePartitionedGraph<N,E>
java.lang.Object
com.luciad.network.graph.partition.TLcdLimitedEditablePartitionedGraph<N,E>
- All Implemented Interfaces:
ILcdGraph<N,,E> ILcdLimitedEditablePartitionedGraph<N,,E> ILcdPartitionedGraph<N,E>
- Direct Known Subclasses:
TLcdPartitionedGraph
public class TLcdLimitedEditablePartitionedGraph<N,E>
extends Object
implements ILcdLimitedEditablePartitionedGraph<N,E>
Implementation of
ILcdLimitedEditablePartitionedGraph. The
getPartitionForNode and getPartitionForEdge methods
can be overwritten by subclasses to improve the performance of this graph
(e.g. when the partition to which a node belongs can be retrieved based on
the geographical location of the node).- Since:
- 5.1
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, emptyTLcdLimitedEditablePartitionedGraph. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBoundaryEdge(E aEdge, N aStartNode, N aEndNode, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Adds the given edge to the boundary graph of this partitioned graph.voidaddGraphListener(ILcdGraphListener<N, E> aGraphListener) Registers the givenILcdGraphListenerwith this graph.voidaddPartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Adds a partition to this graph.voidaddPartitionedGraphListener(ILcdPartitionedGraphListener aPartitionedGraphListener) Registers the givenILcdPartitionedGraphListenerwith this graph.voidboundaryEdgeChanged(E aBoundaryEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) This method should be called when the given boundary edge has changed.voidboundaryEdgesChanged(Vector<E> aBoundaryEdges, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) This method should be called when the given boundary edges have changed.booleancanAddBoundaryEdge(E aEdge, N aStartNode, N aEndNode) Returnstrueif the given boundary edge can be added to this partitioned graph,falseotherwise.booleancanAddPartition(ILcdGraph<N, E> aPartition) Returnstrueif the given partition can be added to this partitioned graph,falseotherwise.booleancanRemoveBoundaryEdge(E aEdge) Returnstrueif the given boundary edge can be removed from this graph,falseotherwise.booleancanRemoveBoundaryEdges(ILcdGraph<N, E> aPartition) Returnstrueif the boundary edge connected to the given partition can be removed from this graph,falseotherwise.booleancanRemovePartition(ILcdGraph<N, E> aPartition) Returnstrueif the given partition can be removed from this partitioned graph,falseotherwise.voidclear(int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Clears the graph; all partitions are removed from this graph and the boundary graph is cleared.voidclearBoundaryGraph(int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Clears the boundary graph of this partitioned graph, i.e. all its boundary edges and boundary nodes are removed from its boundary graph.booleancontainsEdge(E aEdge) Returns true ifaEdgeis contained in this graph, false otherwise.booleancontainsNode(N aNode) Returns true ifaNodeis part of this graph, false otherwise.booleancontainsPartition(ILcdGraph<N, E> aPartition) Returns true if the given graph is a partition of this graph, false otherwise.voidFires all the collected graph changes, i.e., all graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call tofireCollectedGraphChanges().voidFires all the collected partitioned graph changes, i.e., all partitioned graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call tofireCollectedPartitionedGraphChanges().getBoundaryEdges(ILcdGraph<N, E> aPartition) Returns an enumeration containing all boundary edges of the given partition.Returns the boundary graph of this graph.getBoundaryNodes(ILcdGraph<N, E> aPartition) Returns an enumeration containing all boundary nodes of the given partition.getEdges()Returns an Enumeration containing all edges in this graph.Returns an Enumeration containing all edges connected to the given node.getEndNode(E aEdge) Returns the end node of the given edge in this graph.getNodes()Returns an Enumeration containing all nodes in this graph.getOppositeNode(E aEdge, N aNode) IfaNodeis one of the two nodes connected by the given edge in this graph, returns the other node, otherwise throwsIllegalArgumentException.getPartitionForEdge(E aEdge) Returns the partition of this partitioned graph that contains the given edge, ornullif the given edge is not part of a partition in this graph.getPartitionForNode(N aNode) Returns the partition of this partitioned graph that contains the given node, ornullif the given node is not part of a partition in this graph.Returns anEnumerationcontaining all partitions of this graph.getStartNode(E aEdge) Returns the start node of the given edge in this graph.booleanisConnected(E aEdge, N aNode) Returns true ifaNodeis one the nodes to which this edge is connected.removeBoundaryEdge(E aEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Removes the given boundary edge from the boundary graph of this partitioned graph.removeBoundaryEdges(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Removes all boundary edges that are connected to the given partition.voidremoveGraphListener(ILcdGraphListener<N, E> aGraphListener) Unregisters the givenILcdGraphListenerfrom this graph.voidremovePartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Removes the given partition from this graph.voidremovePartitionedGraphListener(ILcdPartitionedGraphListener aPartitionedGraphListener) Unregisters the givenILcdPartitionedGraphListenerfrom this graph.
-
Constructor Details
-
TLcdLimitedEditablePartitionedGraph
public TLcdLimitedEditablePartitionedGraph()Constructs a new, emptyTLcdLimitedEditablePartitionedGraph.
-
-
Method Details
-
canAddBoundaryEdge
Returnstrueif the given boundary edge can be added to this partitioned graph,falseotherwise. More specifically, a boundary edge can be added to this graph if the following conditions are met:- the boundary edge is not
null - the boundary edge is not yet part of this graph
- the given nodes are both part of this graph
- the given nodes are part of different partitions
- the boundary edge satisfies all additional implementation-specific requirements (see the documentation of the implementing class).
containsBoundaryEdgemethod to test whether the given edge is already part of this graph or not, and thegetPartitionForNodemethod to determine in which partition both given nodes are contained.- Specified by:
canAddBoundaryEdgein interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
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.- Returns:
trueif the boundary edge can be added to this graph,falseotherwise.
- the boundary edge is not
-
addBoundaryEdge
public void addBoundaryEdge(E aEdge, N aStartNode, N aEndNode, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraphAdds the given edge to the boundary graph of this partitioned graph.- Specified by:
addBoundaryEdgein interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aEdge- the edge that should be added.aStartNode- the start node of the edge.aEndNode- the end node of the edge.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canAddBoundaryEdge(aEdge, aStartNode, aEndNode)- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
canRemoveBoundaryEdge
Description copied from interface:ILcdLimitedEditablePartitionedGraphReturnstrueif the given boundary edge can be removed from this graph,falseotherwise. More specifically, a boundary edge can be remove from this graph if the following conditions are met:- the boundary edge is not
null - the boundary edge is part of the boundary graph of this partitioned graph
- Specified by:
canRemoveBoundaryEdgein interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aEdge- the boundary edge to be verified.- Returns:
trueif the boundary edge can be removed from this graph,falseotherwise.
- the boundary edge is not
-
removeBoundaryEdge
Description copied from interface:ILcdLimitedEditablePartitionedGraphRemoves the given boundary edge from the boundary graph of this partitioned graph.- Specified by:
removeBoundaryEdgein interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aEdge- the boundary edge that should be removed.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canRemoveBoundaryEdge(aEdge)- Note: this validation is potentially expensive, and should be avoided whenever possible.- Returns:
- the boundary edge that was removed.
-
canRemoveBoundaryEdges
Description copied from interface:ILcdLimitedEditablePartitionedGraphReturnstrueif the boundary edge connected to the given partition can be removed from this graph,falseotherwise. More specifically, the boundary edges connected to the given partition can be removed from this graph if the following conditions are met:- the partition is not
null - the partition is part of this partitioned graph
- Specified by:
canRemoveBoundaryEdgesin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aPartition- the partition to be verified.- Returns:
trueif the boundary edges connected to the given partition can be removed from this graph,falseotherwise.
- the partition is not
-
removeBoundaryEdges
public Enumeration<E> removeBoundaryEdges(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraphRemoves all boundary edges that are connected to the given partition.- Specified by:
removeBoundaryEdgesin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aPartition- the partition whose boundary edges should be removed.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canRemoveBoundaryEdges(aPartition)- Note: this validation is potentially expensive, and should be avoided whenever possible.- Returns:
- an enumeration with all edges that have been removed.
-
clearBoundaryGraph
public void clearBoundaryGraph(int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraphClears the boundary graph of this partitioned graph, i.e. all its boundary edges and boundary nodes are removed from its boundary graph.- Specified by:
clearBoundaryGraphin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
-
canAddPartition
Returnstrueif the given partition can be added to this partitioned graph,falseotherwise. More specifically, a partition can be added to this graph if the following conditions are met:- the partition is not
null - the partition is not yet part of this graph
- the partition contains no nodes or edges that are already part of this graph
- the partition satisfies all additional implementation-specific requirements (see the documentation of the implementing class).
containsPartitionmethod to determine whether the given partition is already part of this graph or not. The implementation iterates over all nodes and edges, using respectively thecontainsPartitionandcontainsBoundaryEdgemethods to verify that no node or edge is already part of this graph.- Specified by:
canAddPartitionin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aPartition- the partition to be verified.- Returns:
trueif the partition can be added to this graph,falseotherwise.
- the partition is not
-
addPartition
public void addPartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraphAdds a partition to this graph. From the moment a partition is added to the partitioned graph, the client becomes partly responsible himself for maintaining the invariants of the partitioned graph in which it is contained. More specifically, the user should always check himself whether adding a node or an edge to a partition, will not violate the invariants that each node and edge should be unique within a graph (the partitioned graph it is part of, in this case). The most easy way to edit partitions without violating the invariants, is to use the edit methods of the partitioned graph, instead of using the methods of the partition directly. These methods will guarantee that no invariant shall be violated.- Specified by:
addPartitionin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aPartition- the partition to be added to this graph.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canAddPartition(aPartition)- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
canRemovePartition
Returnstrueif the given partition can be removed from this partitioned graph,falseotherwise. More specifically, a partition can be removed from this graph if the following conditions are met:- the partition is not
null - the partition is part of this graph
- there are no boundary edges in this graph, connected to the given partition
containsPartitionmethod to determine whether the given partition is part of this graph.- Specified by:
canRemovePartitionin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aPartition- the partition to be verified.- Returns:
trueif the partition can be removed from this graph,falseotherwise.
- the partition is not
-
removePartition
public void removePartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraphRemoves the given partition from this graph. A partition can only be removed if there are no connections any more between that partition and the other partitions. By removing a partition, modifications to the partition have no influence any more on this graph, and can no longer violate its invariants.- Specified by:
removePartitionin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aPartition- the partition to be removed from this graph.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
canRemovePartition(aPartition)- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
clear
public void clear(int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraphClears the graph; all partitions are removed from this graph and the boundary graph is cleared. Note that no recursive clearing is done, i.e. all partitions remain unmodified and can still be used on their own. By clearing the graph, modifications to any of these partitions have no influence any more on this graph, and can no longer violate the invariants of this graph.- Specified by:
clearin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent. This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.
-
fireCollectedPartitionedGraphChanges
public void fireCollectedPartitionedGraphChanges()Description copied from interface:ILcdLimitedEditablePartitionedGraphFires all the collected partitioned graph changes, i.e., all partitioned graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call tofireCollectedPartitionedGraphChanges(). Note that afireCollectedPartitionedGraphChanges()call is made whenever a partitioned graph event is generated in theILcdFireEventMode.FIRE_NOW, to guarantee the correct order of the events.- Specified by:
fireCollectedPartitionedGraphChangesin interfaceILcdLimitedEditablePartitionedGraph<N,E>
-
boundaryEdgeChanged
public void boundaryEdgeChanged(E aBoundaryEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraphThis method should be called when the given boundary edge has changed.- Specified by:
boundaryEdgeChangedin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aBoundaryEdge- the boundary edge that has changed.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
getBoundaryGraph().containsBoundaryEdge(aBoundaryEdge)- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
boundaryEdgesChanged
public void boundaryEdgesChanged(Vector<E> aBoundaryEdges, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraphThis method should be called when the given boundary edges have changed.- Specified by:
boundaryEdgesChangedin interfaceILcdLimitedEditablePartitionedGraph<N,E> - Parameters:
aBoundaryEdges- a vector containing the boundary edges that have changed.aPartitionedGraphFireEventMode- the mode for sending out the TLcdPartitionedGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.aGraphFireEventMode- the mode for sending out the TLcdGraphChangedEvent This can be one ofILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER or ILcdFireEventMode.NO_EVENT.- Preconditions:
- for each
boundaryEdgein the given vector should hold that:getBoundaryGraph().containsBoundaryEdge(boundaryEdge)- Note: this validation is potentially expensive, and should be avoided whenever possible.
-
getPartitions
Description copied from interface:ILcdPartitionedGraphReturns anEnumerationcontaining all partitions of this graph.- Specified by:
getPartitionsin interfaceILcdPartitionedGraph<N,E> - Returns:
- an
Enumerationcontaining all the partitions of this graph.
-
containsPartition
Description copied from interface:ILcdPartitionedGraphReturns true if the given graph is a partition of this graph, false otherwise.- Specified by:
containsPartitionin interfaceILcdPartitionedGraph<N,E> - Parameters:
aPartition- the partition to be checked for.- Returns:
- true if the given graph is a partition of this graph, false otherwise.
-
getPartitionForNode
Description copied from interface:ILcdPartitionedGraphReturns the partition of this partitioned graph that contains the given node, ornullif the given node is not part of a partition in this graph.- Specified by:
getPartitionForNodein interfaceILcdPartitionedGraph<N,E> - Parameters:
aNode- the node whose graph should be returned.- Returns:
- the partition of this graph that contains this node.
-
getPartitionForEdge
Description copied from interface:ILcdPartitionedGraphReturns the partition of this partitioned graph that contains the given edge, ornullif the given edge is not part of a partition in this graph. The partitions connected by a boundary edge should be retrieved by calling thegetPartitionForNodemethod with as argument one of the two nodes connected by this edge.- Specified by:
getPartitionForEdgein interfaceILcdPartitionedGraph<N,E> - Parameters:
aEdge- the edge whose graph should be returned.- Returns:
- the partition of this graph that contains this edge.
-
getBoundaryNodes
Description copied from interface:ILcdPartitionedGraphReturns an enumeration containing all boundary nodes of the given partition.- Specified by:
getBoundaryNodesin interfaceILcdPartitionedGraph<N,E> - Parameters:
aPartition- the partition from which the boundary should be part.- Returns:
- an enumeration containing all boundary nodes of the given partition.
-
getBoundaryEdges
Description copied from interface:ILcdPartitionedGraphReturns an enumeration containing all boundary edges of the given partition.- Specified by:
getBoundaryEdgesin interfaceILcdPartitionedGraph<N,E> - Parameters:
aPartition- the partition to which the boundary edges should be connected.- Returns:
- an enumeration containing all boundary edges of the given partition.
-
getBoundaryGraph
Description copied from interface:ILcdPartitionedGraphReturns the boundary graph of this graph.- Specified by:
getBoundaryGraphin interfaceILcdPartitionedGraph<N,E> - Returns:
- the boundary graph of this graph.
-
addPartitionedGraphListener
Description copied from interface:ILcdPartitionedGraphRegisters the givenILcdPartitionedGraphListenerwith this graph. All events generated by this graph afterwards will be sent to the given listener, until it is removed from this graph.- Specified by:
addPartitionedGraphListenerin interfaceILcdPartitionedGraph<N,E> - Parameters:
aPartitionedGraphListener- the graph listener to be registered with this graph.
-
removePartitionedGraphListener
Description copied from interface:ILcdPartitionedGraphUnregisters the givenILcdPartitionedGraphListenerfrom this graph. After it has been unregistered, no events generated by this graph will be sent to the given listener anymore.- Specified by:
removePartitionedGraphListenerin interfaceILcdPartitionedGraph<N,E> - Parameters:
aPartitionedGraphListener- the graph listener to be unregistered from this graph.
-
containsNode
Description copied from interface:ILcdGraphReturns true ifaNodeis part of this graph, false otherwise.- Specified by:
containsNodein interfaceILcdGraph<N,E> - Parameters:
aNode- the node to be checked.- Returns:
trueifaNodeis part of the graph,falseotherwise.
-
getNodes
Description copied from interface:ILcdGraphReturns an Enumeration containing all nodes in this graph. -
containsEdge
Description copied from interface:ILcdGraphReturns true ifaEdgeis contained in this graph, false otherwise.- Specified by:
containsEdgein interfaceILcdGraph<N,E> - Parameters:
aEdge- the edge to be checked- Returns:
trueifaEdgeis part of the graph,falseotherwise.
-
getEdges
Description copied from interface:ILcdGraphReturns an Enumeration containing all edges in this graph. -
getEdges
Returns an Enumeration containing all edges connected to the given node. This implementation uses thegetPartitionForNodemethod to determine the partition in which the given node is contained.- Specified by:
getEdgesin interfaceILcdGraph<N,E> - Parameters:
aNode- the node whose connected edges should be returned.- Returns:
- an Enumeration containing all edges connected to the given node.
- Throws:
IllegalArgumentException-aNodeis not part of this graph.NullPointerException- if the node isnull.
-
getStartNode
Returns the start node of the given edge in this graph. This implementation uses thegetPartitionForEdgemethod to determine the partition in which the given edge is contained.- Specified by:
getStartNodein interfaceILcdGraph<N,E> - Parameters:
aEdge- the edge whose start node should be returned.- Returns:
- the start node.
- Throws:
IllegalArgumentException-aEdgeis not part of this graph.NullPointerException- if the edge isnull.
-
getEndNode
Returns the end node of the given edge in this graph. This implementation uses thegetPartitionForEdgemethod to determine the partition in which the given edge is contained.- Specified by:
getEndNodein interfaceILcdGraph<N,E> - Parameters:
aEdge- the edge whose end node should be returned.- Returns:
- the end node.
- Throws:
IllegalArgumentException-aEdgeis not part of this graph.NullPointerException- if the edge isnull.
-
getOppositeNode
IfaNodeis one of the two nodes connected by the given edge in this graph, returns the other node, otherwise throwsIllegalArgumentException. This implementation uses thegetPartitionForEdgemethod to determine the partition in which the given edge is contained.- Specified by:
getOppositeNodein interfaceILcdGraph<N,E> - Parameters:
aEdge- the edge whose opposite node should be returned.aNode- one of the twoObject's connected by the given edge.- Returns:
- if
aNodeis one of the two nodes connected by this edge, returns the other node connected by this edge. - Throws:
IllegalArgumentException-aNodeis not connected by this edge oraEdgeis not part of this graph.NullPointerException- if one of the arguments isnull.
-
isConnected
Returns true ifaNodeis one the nodes to which this edge is connected. This implementation uses thegetPartitionForEdgemethod to determine the partition in which the given edge is contained.- Specified by:
isConnectedin interfaceILcdGraph<N,E> - Parameters:
aEdge- the edge whose connectivity should be checked.aNode- the node which connectivity should be checked.- Returns:
- true if
aNodeis one the nodes to which this edge is connected. - Throws:
IllegalArgumentException-aEdgeis not part of this graph.NullPointerException- if one of the arguments isnull.
-
addGraphListener
Description copied from interface:ILcdGraphRegisters the givenILcdGraphListenerwith this graph. All events generated by this graph afterwards will be sent to the given listener, until it is removed from this graph.- Specified by:
addGraphListenerin interfaceILcdGraph<N,E> - Parameters:
aGraphListener- the graph listener to be registered with this graph.
-
removeGraphListener
Description copied from interface:ILcdGraphUnregisters the givenILcdGraphListenerfrom this graph. After it has been unregistered, no events generated by this graph will be sent to the given listener anymore.- Specified by:
removeGraphListenerin interfaceILcdGraph<N,E> - Parameters:
aGraphListener- the graph listener to be unregistered from this graph.
-
fireCollectedGraphChanges
public void fireCollectedGraphChanges()Description copied from interface:ILcdLimitedEditablePartitionedGraphFires all the collected graph changes, i.e., all graph events that have been generated using the ILcdFireEventMode.FIRE_LATER mode, after the previous call tofireCollectedGraphChanges(). Note that afireCollectedGraphChanges()call is made whenever a graph event is generated in theILcdFireEventMode.FIRE_NOW, to guarantee the correct order of the events.- Specified by:
fireCollectedGraphChangesin interfaceILcdLimitedEditablePartitionedGraph<N,E>
-