Package org.planit.graph
Class VertexImpl.EdgeSegmentsImpl
- java.lang.Object
-
- org.planit.graph.VertexImpl.EdgeSegmentsImpl
-
- All Implemented Interfaces:
Iterable<EdgeSegment>
,Vertex.EdgeSegments
- Enclosing class:
- VertexImpl
public class VertexImpl.EdgeSegmentsImpl extends Object implements Vertex.EdgeSegments
EdgeSegment container- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<EdgeSegment>
edgeSegments
Edge segments which connect to this vertex
-
Constructor Summary
Constructors Constructor Description EdgeSegmentsImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addEdgeSegment(EdgeSegment edgeSegment)
#Add edgeSegment, do not invoke when parsing networks, this connection is auto-populated before the assignment starts based on the edge segment vertices that have been registered.int
getNumberOfEdges()
#Number of entries in edge segmentsboolean
isEmpty()
#Test whether no edge segments have been registeredIterator<EdgeSegment>
iterator()
Iterator over available edge segmentsboolean
removeEdgeSegment(EdgeSegment edgeSegment)
#Remove edgeSegment-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
edgeSegments
protected Set<EdgeSegment> edgeSegments
Edge segments which connect to this vertex
-
-
Method Detail
-
addEdgeSegment
public boolean addEdgeSegment(EdgeSegment edgeSegment)
#Add edgeSegment, do not invoke when parsing networks, this connection is auto-populated before the assignment starts based on the edge segment vertices that have been registered.- Specified by:
addEdgeSegment
in interfaceVertex.EdgeSegments
- Parameters:
edgeSegment
- EdgeSegment object to be added- Returns:
- true when added, false when already present (and not added)
-
removeEdgeSegment
public boolean removeEdgeSegment(EdgeSegment edgeSegment)
#Remove edgeSegment- Specified by:
removeEdgeSegment
in interfaceVertex.EdgeSegments
- Parameters:
edgeSegment
- EdgeSegment object to be removed- Returns:
- true when removed, false when not present (and not removed)
-
isEmpty
public boolean isEmpty()
#Test whether no edge segments have been registered- Specified by:
isEmpty
in interfaceVertex.EdgeSegments
- Returns:
- true if no edge segments have been registered, false otherwise
-
getNumberOfEdges
public int getNumberOfEdges()
#Number of entries in edge segments- Specified by:
getNumberOfEdges
in interfaceVertex.EdgeSegments
- Returns:
- the number of edges connected to this vertex
-
iterator
public Iterator<EdgeSegment> iterator()
Iterator over available edge segments- Specified by:
iterator
in interfaceIterable<EdgeSegment>
-
-