gps.network.graph
Class Node

java.lang.Object
  extended by gps.network.graph.Node
All Implemented Interfaces:
SimEventHandler

public class Node
extends java.lang.Object
implements SimEventHandler

Represents a network node. To get and change the properties of the node call node.getProperties().

Author:
Oliver Heckmann

Field Summary
static int mNextAvailableID
          provide next available id for automatically indexing
 
Constructor Summary
Node()
          Creates new Node, standard constructor.
Node(int i)
          initialization with specified node id
 
Method Summary
 void attach(Agent a)
          attachs agents on that node
 java.util.ArrayList getAgentList()
          gets agent list attached on this node
 int getID()
          gets node id
 int getKey()
          gets node id
 Link getLinkTo(Node n)
          gets link to another node
 NodeProperties getProperties()
          gets node properties
 boolean handle(SimEvent e)
          handles node level event
 void hasLinkTo(Node n, Link l)
          add a link between this node and another node
 boolean isActive()
          checks activity
 void reset()
          reset values
 void setID(int i)
          set id
 void setProperties(NodeProperties p)
          sets node propertes
 java.lang.String toString()
          gets string description
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mNextAvailableID

public static int mNextAvailableID
provide next available id for automatically indexing

Constructor Detail

Node

public Node()
Creates new Node, standard constructor.


Node

public Node(int i)
initialization with specified node id

Parameters:
i - node id
Method Detail

reset

public void reset()
reset values


setID

public void setID(int i)
set id

Parameters:
i - new id

getID

public int getID()
gets node id

Returns:
node id

getKey

public int getKey()
gets node id

Returns:
node id

getProperties

public NodeProperties getProperties()
gets node properties

Returns:
node properties

setProperties

public void setProperties(NodeProperties p)
sets node propertes

Parameters:
p - node properties

getAgentList

public java.util.ArrayList getAgentList()
gets agent list attached on this node


hasLinkTo

public void hasLinkTo(Node n,
                      Link l)
add a link between this node and another node

Parameters:
n - another node
l - link between two nodes

getLinkTo

public Link getLinkTo(Node n)
gets link to another node

Parameters:
n - destination node
Returns:
link

isActive

public boolean isActive()
checks activity

Returns:
true if activated

handle

public boolean handle(SimEvent e)
handles node level event

Specified by:
handle in interface SimEventHandler
Parameters:
e - is the event to be handled
Returns:
true if already handled

attach

public void attach(Agent a)
attachs agents on that node

Parameters:
a - the agent to be attached

toString

public java.lang.String toString()
gets string description

Overrides:
toString in class java.lang.Object
Returns:
string description