public class Node
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addIncomingLink(Network net,
Node node)
Adds an incoming link to this node coming from another node a.
|
void |
addOutGoingLink(Network net,
Node node)
Adds an outgoing link to this node coming from another node a.
|
void |
clear()
Resets this node completely for all networks, removing all links
|
void |
clearNetwork(Network network)
Removes all links of this node in a given network, use with caution as the network representation can become inconsistent.
|
static Node |
createNode(java.lang.String name)
Method responsible for creating a node.
|
boolean |
equals(java.lang.Object a)
Overrides equals method, two nodes should be identical if their name is the same
|
java.util.ArrayList<Node> |
getBiDirectionalLinks(Network network)
Returns list of nodes connected by a birectional link in a given network context
|
java.util.ArrayList<Node> |
getIncomingLinks(Network net)
Returns list of nodes connected by an incoming link in a given network context
|
java.lang.String |
getName()
Getter for name of node
|
java.util.ArrayList<Node> |
getOutGoingLinks(Network net)
Returns list of nodes connected by an outgoing link in a given network context
|
java.util.HashSet<Node> |
getUnidirectedLinks(Network net)
Returns list of nodes connected by any type of link in a given network context
|
int |
hashCode()
Overrides hashcode to be represented by the name of the node since this is unique
|
void |
removeIncomingLink(Network net,
Node node)
Removes an incoming link to this node coming from another node a.
|
void |
removeOutGoingLink(Network net,
Node node)
Removes an outgoing link to this node coming from another node a.
|
void |
resetNodeConnectivity(Network network)
Similar to 'clearNetwork' this method resets a given network context.
|
void |
setName(java.lang.String name)
Setter for name of node
|
java.lang.String |
toString()
Overrides to String method, simple prints the name of node
|
public static Node createNode(java.lang.String name)
name
- name of the node to be createdpublic void addIncomingLink(Network net, Node node)
net
- network context of the linknode
- node to be connected by the linkpublic void addOutGoingLink(Network net, Node node)
net
- network context of the linknode
- node to be connected by the linkpublic void removeIncomingLink(Network net, Node node)
net
- network context of the linknode
- node to removedpublic void removeOutGoingLink(Network net, Node node)
net
- network context of the linknode
- node to removedpublic java.util.ArrayList<Node> getBiDirectionalLinks(Network network)
net
- network context of the linkpublic java.util.ArrayList<Node> getIncomingLinks(Network net)
net
- network context of the linkpublic java.util.ArrayList<Node> getOutGoingLinks(Network net)
net
- network context of the linkpublic java.util.HashSet<Node> getUnidirectedLinks(Network net)
net
- network context of the linkpublic java.lang.String getName()
public void setName(java.lang.String name)
node's
- namepublic boolean equals(java.lang.Object a)
equals
in class java.lang.Object
any
- object to compare topublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void clear()
public void clearNetwork(Network network)
the
- network context to be removedpublic void resetNodeConnectivity(Network network)
the
- network context to be reset