public class Node
extends java.lang.Object
Constructor and Description |
---|
Node(int id,
Nucleotide nucleotide)
Constructor of the Node
|
Node(int id,
Nucleotide nucl,
boolean isCity,
playn.core.GroupLayer graphLayer,
int graph_id,
int player_id)
Constructor of the Node(Complete version)
|
Modifier and Type | Method and Description |
---|---|
void |
addNeighbor(Node n)
Adds the specific node to the list of neighbors
|
Base |
getBase() |
int |
getGraphId() |
playn.core.GroupLayer |
getGraphLayer() |
int |
getID() |
Node |
getMappedNode()
Returns the node which this instance is mapped to
|
Mapping |
getMapping()
Returns the mapping this node has
|
java.util.List<Node> |
getNeighbors() |
int |
getNodeLevel() |
Nucleotide |
getNucleotide() |
int |
getPlayer() |
Tuple2f |
getPos() |
boolean |
isPlaced() |
void |
paint()
paints all the images contained in this node
|
void |
placeNode(float x,
float y)
places the node at the given (x,y) coordinates and flags placed to true
|
void |
setMappedNode(Node node)
Sets the mapped_node to be the given node
|
void |
setMapping(Node node)
Sets a mapping from this node to the given node
|
void |
setNodeLevel()
automaticly sets the population of this node to its degree
|
void |
setPos(float x,
float y)
Sets the coordinates of this node to the given values
|
java.lang.String |
toString() |
void |
unMap()
Removes the existing mapping from this node to the given node
Note : If used on a node with no mapping will cause a NullPointerException
|
public Node(int id, Nucleotide nucleotide)
id
- - the unique integer associated with this node read from the raw datanucl
- - type of Nucleotide read from raw datapublic Node(int id, Nucleotide nucl, boolean isCity, playn.core.GroupLayer graphLayer, int graph_id, int player_id)
id
- - the unique integer associated with this node read from the raw datanucl
- - type of Nucleotide read from raw dataisCity
- - boolean value determining whether this node is city or campgraphLayer
- - the GroupLayer of the graphplayer_id
- - the unique integer value of the player assigned to this graphpublic playn.core.GroupLayer getGraphLayer()
public void setMapping(Node node)
node
- - the node to be mapped topublic Mapping getMapping()
public void unMap()
public Node getMappedNode()
public void setMappedNode(Node node)
node
- - the instance of Nodepublic int getGraphId()
public int getPlayer()
public void placeNode(float x, float y)
x
- - float x coordinatey
- - float y coordinatepublic void paint()
public boolean isPlaced()
public void addNeighbor(Node n)
n
- - instance of Nodepublic java.util.List<Node> getNeighbors()
public void setNodeLevel()
public int getNodeLevel()
public int getID()
public Tuple2f getPos()
public void setPos(float x, float y)
x
- - float x coordinatey
- - float y coordinatepublic Nucleotide getNucleotide()
public Base getBase()
public java.lang.String toString()
toString
in class java.lang.Object