public class NodesPositionMatrix extends AbstractNodesPositionMatrix
Constructor and Description |
---|
NodesPositionMatrix(NodesList nodes) |
Modifier and Type | Method and Description |
---|---|
boolean |
changeNodePosition(Node n,
Position oldPosition,
Position newPosition)
Change the position of a Node wich is located inside a NodeList.
|
AbstractNodesList |
getNodeAt(int x,
int y)
Retrieve a NodeList located at position (x,y).
|
java.util.List<Node> |
possibleNeighbours(Node n,
Position p)
Retrieve a set of Nodes which can be the possible neighbour of the Node n.
|
void |
rebuild(AbstractNodesList nodes)
Rebuild the current NodeMatrix and add the content of nodes
into this new matrix.
|
size
public NodesPositionMatrix(NodesList nodes)
public AbstractNodesList getNodeAt(int x, int y)
AbstractNodesPositionMatrix
getNodeAt
in class AbstractNodesPositionMatrix
x
- - the x-position of the NodeListy
- - the y-position of the NodeListpublic boolean changeNodePosition(Node n, Position oldPosition, Position newPosition)
AbstractNodesPositionMatrix
changeNodePosition
in class AbstractNodesPositionMatrix
n
- - the node to change its positionoldPosition
- - the old position where the node was locatednewPosition
- - the new position where the node should be storedpublic void rebuild(AbstractNodesList nodes)
AbstractNodesPositionMatrix
rebuild
in class AbstractNodesPositionMatrix
nodes
- - the set of NodesList to be added.public java.util.List<Node> possibleNeighbours(Node n, Position p)
AbstractNodesPositionMatrix
possibleNeighbours
in class AbstractNodesPositionMatrix
n
- - the node whose neighbours should be listedp
- - the current position of the node