public class NodeWrapper extends java.lang.Object implements Node
Constructor and Description |
---|
NodeWrapper(Node wrappedNode) |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(Edge edge)
Adds an edge to this node, if it doesn't exist yet.
|
boolean |
equals(java.lang.Object obj) |
java.util.Collection<Edge> |
getEdges()
Returns all ingoing and outgoing edges of this node.
|
<T> java.util.Optional<T> |
getMetaInformation(java.lang.Class<T> clazz)
Gets the meta information contained in this node if it exists.
|
java.util.Optional<Position> |
getOldPosition()
Get the previous position of this node, if any exists.
|
Position |
getPosition()
Get the current position of this node.
|
java.lang.Object |
getValue()
Returns the value stored in this node.
|
Node |
getWrappedNode() |
int |
hashCode() |
void |
removeEdge(Edge edge)
Removes an edge from this node, if it exists.
|
<T> void |
setMetaInformation(T meta)
Set the meta information contained in this node.
|
void |
setOldPosition(Position oldPosition)
Set the old position to the given position.
|
void |
setPosition(Position position)
Set the position of this node.
|
void |
setValue(java.lang.Object value)
Sets the value stored in this node.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
distance, distanceSquared, getEdgeForNeighbor, getIncomingEdges, getNeighbors, getOutgoingEdges, getPredecessors, getSuccessors, hasSuccessor, setOldPosition
public NodeWrapper(Node wrappedNode)
public Node getWrappedNode()
public java.lang.Object getValue()
Node
public void setValue(java.lang.Object value)
Node
public void addEdge(Edge edge)
Node
public void removeEdge(Edge edge)
Node
removeEdge
in interface Node
edge
- The edge to remove.public java.util.Collection<Edge> getEdges()
Node
public java.util.Optional<Position> getOldPosition()
Node
getOldPosition
in interface Node
public void setOldPosition(Position oldPosition)
Node
setOldPosition
in interface Node
oldPosition
- The new old position.public Position getPosition()
Node
getPosition
in interface Node
public void setPosition(Position position)
Node
setPosition
in interface Node
position
- The new position.public <T> void setMetaInformation(T meta)
Node
setMetaInformation
in interface Node
T
- The type of the new piece of meta information.meta
- The new piece of meta information.public <T> java.util.Optional<T> getMetaInformation(java.lang.Class<T> clazz)
Node
getMetaInformation
in interface Node
T
- The type of the meta information object.clazz
- The class of the meta information object.public java.lang.String toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object