main
Class Node

java.lang.Object
  extended by main.MapComponent
      extended by main.Node
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
X2XProxy

public class Node
extends MapComponent
implements java.lang.Cloneable

The Node class represents one node on the PlanetLab network. The class contains only the information required to draw the node on a map. This includes an id, GPS position, and properties that are attributed to the color and size of the node on the map.

See Also:
Edge

Field Summary
private  java.lang.String city
           
private  java.awt.Color color
           
private  java.lang.String country
           
static java.awt.Color defaultColor
           
private  java.lang.String hostname
           
private  java.lang.Integer id
           
private  java.lang.String ip
           
private  boolean isSliceNode
           
private  Position position
           
private  java.lang.String region
           
private  int size
           
static int sizeSmall
           
static java.lang.String SLICE_NODE_PREFIX
           
 
Constructor Summary
Node()
          Creates a new Node and initializes all members to null.
Node(java.lang.Integer id, Position position, java.lang.Double weightColor, java.lang.Double weightSize)
          Creates a new Node with the arguments.
Node(java.lang.Integer id, Position position, java.lang.Double weightColor, java.lang.Double weightSize, java.lang.String country, java.lang.String region, java.lang.String city)
          Creates a new Node with the arguments.
 
Method Summary
 Node clone()
          clones the object
 void copyValuesToNode(Node destNode)
          Copies the values of this instance to the destNode
 boolean equals(java.lang.Object obj)
          Indicates whether some other Node is "equal to" this one.
 java.lang.String getCity()
           
 java.awt.Color getColor()
           
 java.lang.String getCountry()
           
 java.lang.String getHostname()
           
 java.lang.Integer getId()
          Returns the node's id.
 java.lang.String getIp()
           
 Position getPosition()
          Returns the node's GPS position.
 java.lang.String getRegion()
           
 int getSize()
           
 boolean isSliceNode()
           
 void setCity(java.lang.String city)
           
 void setColor(java.awt.Color color)
           
 void setCountry(java.lang.String country)
           
 void setHostname(java.lang.String hostname)
           
 void setId(java.lang.Integer id)
           
 void setIp(java.lang.String ip)
           
 void setPosition(Position position)
           
 void setRegion(java.lang.String region)
           
 void setSize(int size)
           
 void setSliceNode(boolean isSliceNode)
           
 java.lang.String toString()
          Returns a string representation of this Node.
 
Methods inherited from class main.MapComponent
getWeightColor, getWeightSize, setWeightColor, setWeightSize
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private java.lang.Integer id

hostname

private java.lang.String hostname

ip

private java.lang.String ip

color

private java.awt.Color color

size

private int size

position

private Position position

city

private java.lang.String city

country

private java.lang.String country

region

private java.lang.String region

defaultColor

public static final java.awt.Color defaultColor

sizeSmall

public static final int sizeSmall
See Also:
Constant Field Values

SLICE_NODE_PREFIX

public static final java.lang.String SLICE_NODE_PREFIX
See Also:
Constant Field Values

isSliceNode

private boolean isSliceNode
Constructor Detail

Node

public Node(java.lang.Integer id,
            Position position,
            java.lang.Double weightColor,
            java.lang.Double weightSize)
Creates a new Node with the arguments. The members hostname and ip are set to null.

Parameters:
id - an Integer representing the node's id
position - the Position of the node
weightColor - a Double that contains the value to be attributed to the node's color
weightSize - a Double that contains the value to be attributed to the node's size

Node

public Node(java.lang.Integer id,
            Position position,
            java.lang.Double weightColor,
            java.lang.Double weightSize,
            java.lang.String country,
            java.lang.String region,
            java.lang.String city)
Creates a new Node with the arguments. The members hostname and ip are set to null.

Parameters:
id - an Integer representing the node's id
position - the Position of the node
weightColor - a Double that contains the value to be attributed to the node's color
weightSize - a Double that contains the value to be attributed to the node's size
city - name of the nearest city to position

Node

public Node()
Creates a new Node and initializes all members to null.

Method Detail

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other Node is "equal to" this one.

Overrides:
equals in class java.lang.Object

getId

public java.lang.Integer getId()
Returns the node's id.

Returns:
the node's id

getPosition

public Position getPosition()
Returns the node's GPS position.

Returns:
the node's position

toString

public java.lang.String toString()
Returns a string representation of this Node. This is for debugging purposes only.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this Node

setId

public void setId(java.lang.Integer id)
Parameters:
id - the id to set

setPosition

public void setPosition(Position position)
Parameters:
position - the position to set

getHostname

public java.lang.String getHostname()
Returns:
the hostname

setHostname

public void setHostname(java.lang.String hostname)
Parameters:
hostname - the hostname to set

getIp

public java.lang.String getIp()
Returns:
the ip - a String containing the ip-address of the node

setIp

public void setIp(java.lang.String ip)
Parameters:
ip - the ip to set

getCity

public java.lang.String getCity()
Returns:
the city

setCity

public void setCity(java.lang.String city)
Parameters:
city - the city to set

getColor

public java.awt.Color getColor()
Returns:
the color

setColor

public void setColor(java.awt.Color color)
Parameters:
color - the color to set

getCountry

public java.lang.String getCountry()
Returns:
the country

setCountry

public void setCountry(java.lang.String country)
Parameters:
country - the country to set

getRegion

public java.lang.String getRegion()
Returns:
the region

setRegion

public void setRegion(java.lang.String region)
Parameters:
region - the region to set

clone

public Node clone()
           throws java.lang.CloneNotSupportedException
clones the object

Overrides:
clone in class MapComponent
Throws:
java.lang.CloneNotSupportedException

copyValuesToNode

public void copyValuesToNode(Node destNode)
Copies the values of this instance to the destNode

Parameters:
destNode -

isSliceNode

public boolean isSliceNode()

setSliceNode

public void setSliceNode(boolean isSliceNode)

getSize

public int getSize()

setSize

public void setSize(int size)