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
ConstructorDescriptionConstructs a new, emptyTLcdLimitedEditablePartitionedGraph
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBoundaryEdge
(E aEdge, N aStartNode, N aEndNode, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Adds the given edge to the boundary graph of this partitioned graph.void
addGraphListener
(ILcdGraphListener<N, E> aGraphListener) Registers the givenILcdGraphListener
with this graph.void
addPartition
(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Adds a partition to this graph.void
addPartitionedGraphListener
(ILcdPartitionedGraphListener aPartitionedGraphListener) Registers the givenILcdPartitionedGraphListener
with this graph.void
boundaryEdgeChanged
(E aBoundaryEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) This method should be called when the given boundary edge has changed.void
boundaryEdgesChanged
(Vector<E> aBoundaryEdges, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) This method should be called when the given boundary edges have changed.boolean
canAddBoundaryEdge
(E aEdge, N aStartNode, N aEndNode) Returnstrue
if the given boundary edge can be added to this partitioned graph,false
otherwise.boolean
canAddPartition
(ILcdGraph<N, E> aPartition) Returnstrue
if the given partition can be added to this partitioned graph,false
otherwise.boolean
canRemoveBoundaryEdge
(E aEdge) Returnstrue
if the given boundary edge can be removed from this graph,false
otherwise.boolean
canRemoveBoundaryEdges
(ILcdGraph<N, E> aPartition) Returnstrue
if the boundary edge connected to the given partition can be removed from this graph,false
otherwise.boolean
canRemovePartition
(ILcdGraph<N, E> aPartition) Returnstrue
if the given partition can be removed from this partitioned graph,false
otherwise.void
clear
(int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Clears the graph; all partitions are removed from this graph and the boundary graph is cleared.void
clearBoundaryGraph
(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.boolean
containsEdge
(E aEdge) Returns true ifaEdge
is contained in this graph, false otherwise.boolean
containsNode
(N aNode) Returns true ifaNode
is part of this graph, false otherwise.boolean
containsPartition
(ILcdGraph<N, E> aPartition) Returns true if the given graph is a partition of this graph, false otherwise.void
Fires 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()
.void
Fires 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) IfaNode
is 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, ornull
if 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, ornull
if the given node is not part of a partition in this graph.Returns anEnumeration
containing all partitions of this graph.getStartNode
(E aEdge) Returns the start node of the given edge in this graph.boolean
isConnected
(E aEdge, N aNode) Returns true ifaNode
is 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.void
removeGraphListener
(ILcdGraphListener<N, E> aGraphListener) Unregisters the givenILcdGraphListener
from this graph.void
removePartition
(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Removes the given partition from this graph.void
removePartitionedGraphListener
(ILcdPartitionedGraphListener aPartitionedGraphListener) Unregisters the givenILcdPartitionedGraphListener
from this graph.
-
Constructor Details
-
TLcdLimitedEditablePartitionedGraph
public TLcdLimitedEditablePartitionedGraph()Constructs a new, emptyTLcdLimitedEditablePartitionedGraph
.
-
-
Method Details
-
canAddBoundaryEdge
Returnstrue
if the given boundary edge can be added to this partitioned graph,false
otherwise. 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).
containsBoundaryEdge
method to test whether the given edge is already part of this graph or not, and thegetPartitionForNode
method to determine in which partition both given nodes are contained.- Specified by:
canAddBoundaryEdge
in 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:
true
if the boundary edge can be added to this graph,false
otherwise.
- the boundary edge is not
-
addBoundaryEdge
public void addBoundaryEdge(E aEdge, N aStartNode, N aEndNode, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraph
Adds the given edge to the boundary graph of this partitioned graph.- Specified by:
addBoundaryEdge
in 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:ILcdLimitedEditablePartitionedGraph
Returnstrue
if the given boundary edge can be removed from this graph,false
otherwise. 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:
canRemoveBoundaryEdge
in interfaceILcdLimitedEditablePartitionedGraph<N,
E> - Parameters:
aEdge
- the boundary edge to be verified.- Returns:
true
if the boundary edge can be removed from this graph,false
otherwise.
- the boundary edge is not
-
removeBoundaryEdge
Description copied from interface:ILcdLimitedEditablePartitionedGraph
Removes the given boundary edge from the boundary graph of this partitioned graph.- Specified by:
removeBoundaryEdge
in 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:ILcdLimitedEditablePartitionedGraph
Returnstrue
if the boundary edge connected to the given partition can be removed from this graph,false
otherwise. 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:
canRemoveBoundaryEdges
in interfaceILcdLimitedEditablePartitionedGraph<N,
E> - Parameters:
aPartition
- the partition to be verified.- Returns:
true
if the boundary edges connected to the given partition can be removed from this graph,false
otherwise.
- the partition is not
-
removeBoundaryEdges
public Enumeration<E> removeBoundaryEdges(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraph
Removes all boundary edges that are connected to the given partition.- Specified by:
removeBoundaryEdges
in 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:ILcdLimitedEditablePartitionedGraph
Clears the boundary graph of this partitioned graph, i.e. all its boundary edges and boundary nodes are removed from its boundary graph.- Specified by:
clearBoundaryGraph
in 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
Returnstrue
if the given partition can be added to this partitioned graph,false
otherwise. 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).
containsPartition
method to determine whether the given partition is already part of this graph or not. The implementation iterates over all nodes and edges, using respectively thecontainsPartition
andcontainsBoundaryEdge
methods to verify that no node or edge is already part of this graph.- Specified by:
canAddPartition
in interfaceILcdLimitedEditablePartitionedGraph<N,
E> - Parameters:
aPartition
- the partition to be verified.- Returns:
true
if the partition can be added to this graph,false
otherwise.
- the partition is not
-
addPartition
public void addPartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraph
Adds 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:
addPartition
in 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
Returnstrue
if the given partition can be removed from this partitioned graph,false
otherwise. 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
containsPartition
method to determine whether the given partition is part of this graph.- Specified by:
canRemovePartition
in interfaceILcdLimitedEditablePartitionedGraph<N,
E> - Parameters:
aPartition
- the partition to be verified.- Returns:
true
if the partition can be removed from this graph,false
otherwise.
- the partition is not
-
removePartition
public void removePartition(ILcdGraph<N, E> aPartition, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraph
Removes 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:
removePartition
in 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:ILcdLimitedEditablePartitionedGraph
Clears 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:
clear
in 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:ILcdLimitedEditablePartitionedGraph
Fires 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:
fireCollectedPartitionedGraphChanges
in interfaceILcdLimitedEditablePartitionedGraph<N,
E>
-
boundaryEdgeChanged
public void boundaryEdgeChanged(E aBoundaryEdge, int aPartitionedGraphFireEventMode, int aGraphFireEventMode) Description copied from interface:ILcdLimitedEditablePartitionedGraph
This method should be called when the given boundary edge has changed.- Specified by:
boundaryEdgeChanged
in 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:ILcdLimitedEditablePartitionedGraph
This method should be called when the given boundary edges have changed.- Specified by:
boundaryEdgesChanged
in 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
boundaryEdge
in 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:ILcdPartitionedGraph
Returns anEnumeration
containing all partitions of this graph.- Specified by:
getPartitions
in interfaceILcdPartitionedGraph<N,
E> - Returns:
- an
Enumeration
containing all the partitions of this graph.
-
containsPartition
Description copied from interface:ILcdPartitionedGraph
Returns true if the given graph is a partition of this graph, false otherwise.- Specified by:
containsPartition
in 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:ILcdPartitionedGraph
Returns the partition of this partitioned graph that contains the given node, ornull
if the given node is not part of a partition in this graph.- Specified by:
getPartitionForNode
in 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:ILcdPartitionedGraph
Returns the partition of this partitioned graph that contains the given edge, ornull
if the given edge is not part of a partition in this graph. The partitions connected by a boundary edge should be retrieved by calling thegetPartitionForNode
method with as argument one of the two nodes connected by this edge.- Specified by:
getPartitionForEdge
in 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:ILcdPartitionedGraph
Returns an enumeration containing all boundary nodes of the given partition.- Specified by:
getBoundaryNodes
in 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:ILcdPartitionedGraph
Returns an enumeration containing all boundary edges of the given partition.- Specified by:
getBoundaryEdges
in 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:ILcdPartitionedGraph
Returns the boundary graph of this graph.- Specified by:
getBoundaryGraph
in interfaceILcdPartitionedGraph<N,
E> - Returns:
- the boundary graph of this graph.
-
addPartitionedGraphListener
Description copied from interface:ILcdPartitionedGraph
Registers the givenILcdPartitionedGraphListener
with 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:
addPartitionedGraphListener
in interfaceILcdPartitionedGraph<N,
E> - Parameters:
aPartitionedGraphListener
- the graph listener to be registered with this graph.
-
removePartitionedGraphListener
Description copied from interface:ILcdPartitionedGraph
Unregisters the givenILcdPartitionedGraphListener
from this graph. After it has been unregistered, no events generated by this graph will be sent to the given listener anymore.- Specified by:
removePartitionedGraphListener
in interfaceILcdPartitionedGraph<N,
E> - Parameters:
aPartitionedGraphListener
- the graph listener to be unregistered from this graph.
-
containsNode
Description copied from interface:ILcdGraph
Returns true ifaNode
is part of this graph, false otherwise.- Specified by:
containsNode
in interfaceILcdGraph<N,
E> - Parameters:
aNode
- the node to be checked.- Returns:
true
ifaNode
is part of the graph,false
otherwise.
-
getNodes
Description copied from interface:ILcdGraph
Returns an Enumeration containing all nodes in this graph. -
containsEdge
Description copied from interface:ILcdGraph
Returns true ifaEdge
is contained in this graph, false otherwise.- Specified by:
containsEdge
in interfaceILcdGraph<N,
E> - Parameters:
aEdge
- the edge to be checked- Returns:
true
ifaEdge
is part of the graph,false
otherwise.
-
getEdges
Description copied from interface:ILcdGraph
Returns an Enumeration containing all edges in this graph. -
getEdges
Returns an Enumeration containing all edges connected to the given node. This implementation uses thegetPartitionForNode
method to determine the partition in which the given node is contained.- Specified by:
getEdges
in 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
-aNode
is 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 thegetPartitionForEdge
method to determine the partition in which the given edge is contained.- Specified by:
getStartNode
in interfaceILcdGraph<N,
E> - Parameters:
aEdge
- the edge whose start node should be returned.- Returns:
- the start node.
- Throws:
IllegalArgumentException
-aEdge
is 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 thegetPartitionForEdge
method to determine the partition in which the given edge is contained.- Specified by:
getEndNode
in interfaceILcdGraph<N,
E> - Parameters:
aEdge
- the edge whose end node should be returned.- Returns:
- the end node.
- Throws:
IllegalArgumentException
-aEdge
is not part of this graph.NullPointerException
- if the edge isnull
.
-
getOppositeNode
IfaNode
is one of the two nodes connected by the given edge in this graph, returns the other node, otherwise throwsIllegalArgumentException
. This implementation uses thegetPartitionForEdge
method to determine the partition in which the given edge is contained.- Specified by:
getOppositeNode
in 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
aNode
is one of the two nodes connected by this edge, returns the other node connected by this edge. - Throws:
IllegalArgumentException
-aNode
is not connected by this edge oraEdge
is not part of this graph.NullPointerException
- if one of the arguments isnull
.
-
isConnected
Returns true ifaNode
is one the nodes to which this edge is connected. This implementation uses thegetPartitionForEdge
method to determine the partition in which the given edge is contained.- Specified by:
isConnected
in interfaceILcdGraph<N,
E> - Parameters:
aEdge
- the edge whose connectivity should be checked.aNode
- the node which connectivity should be checked.- Returns:
- true if
aNode
is one the nodes to which this edge is connected. - Throws:
IllegalArgumentException
-aEdge
is not part of this graph.NullPointerException
- if one of the arguments isnull
.
-
addGraphListener
Description copied from interface:ILcdGraph
Registers the givenILcdGraphListener
with 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:
addGraphListener
in interfaceILcdGraph<N,
E> - Parameters:
aGraphListener
- the graph listener to be registered with this graph.
-
removeGraphListener
Description copied from interface:ILcdGraph
Unregisters the givenILcdGraphListener
from this graph. After it has been unregistered, no events generated by this graph will be sent to the given listener anymore.- Specified by:
removeGraphListener
in interfaceILcdGraph<N,
E> - Parameters:
aGraphListener
- the graph listener to be unregistered from this graph.
-
fireCollectedGraphChanges
public void fireCollectedGraphChanges()Description copied from interface:ILcdLimitedEditablePartitionedGraph
Fires 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:
fireCollectedGraphChanges
in interfaceILcdLimitedEditablePartitionedGraph<N,
E>
-