Package org.planit.network.physical
Class LinksImpl<L extends Link>
- java.lang.Object
-
- org.planit.network.physical.LinksImpl<L>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description L
get(long id)
Get edge by idboolean
isEmpty()
Check if is emptyIterator<L>
iterator()
L
registerNew(Vertex vertexA, Vertex vertexB, double length, boolean registerOnNodes)
Create new link to network identified via its id, injecting link length directlyL
registerUniqueCopyOf(L edgeToCopy)
copy the passed in edge and register itvoid
remove(long linkId)
remove an edge.void
remove(L link)
remove an edge.int
size()
Get the number of edges in the graph-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.planit.utils.graph.Edges
registerNew
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
remove
public void remove(L link)
remove an edge.
-
remove
public void remove(long linkId)
remove an edge.
-
registerNew
public L registerNew(Vertex vertexA, Vertex vertexB, double length, boolean registerOnNodes) throws PlanItException
Create new link to network identified via its id, injecting link length directly- Specified by:
registerNew
in interfaceEdges<L extends Link>
- Parameters:
vertexA
- the first node in this linkvertexB
- the second node in this linklength
- the length of this linkregisterOnNodes
- choice to register new link on the nodes or not- Returns:
- the created link
- Throws:
PlanItException
- thrown if there is an error
-
registerUniqueCopyOf
public L registerUniqueCopyOf(L edgeToCopy)
copy the passed in edge and register it- Specified by:
registerUniqueCopyOf
in interfaceEdges<L extends Link>
- Parameters:
edgeToCopy
- as is except for its ids which will be updated to makeit uniquely identifiable- Returns:
- copy of edge now registered
-
get
public L get(long id)
Get edge by id
-
size
public int size()
Get the number of edges in the graph
-
isEmpty
public boolean isEmpty()
Check if is empty
-
-