Package org.planit.network.physical
Class NodesImpl<N extends Node>
- java.lang.Object
-
- org.planit.network.physical.NodesImpl<N>
-
- Type Parameters:
N
- concrete class of nodes that are being created
public class NodesImpl<N extends Node> extends Object implements Nodes<N>
Nodes implementation wrapper that simply utilises passed in vertices of the desired generic type to delegate registration and creation of its nodes on- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description N
createNew()
Create a new vertex (without registering on this class)N
get(long id)
Find a entity by its dIterator<N>
iterator()
N
register(N node)
Add to the containerN
registerNew()
Create and register new entityvoid
remove(long nodeId)
Remove by idvoid
remove(N node)
Removeint
size()
Return number of registered entity-
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
-
-
-
-
Method Detail
-
remove
public void remove(N node)
Remove
-
remove
public void remove(long nodeId)
Remove by id
-
createNew
public N createNew()
Create a new vertex (without registering on this class)
-
registerNew
public N registerNew()
Create and register new entity- Specified by:
registerNew
in interfaceVertices<N extends Node>
- Returns:
- new node created
-
size
public int size()
Return number of registered entity
-
-