|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmain.MapComponent
main.Node
public class Node
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.
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 |
---|
private java.lang.Integer id
private java.lang.String hostname
private java.lang.String ip
private java.awt.Color color
private int size
private Position position
private java.lang.String city
private java.lang.String country
private java.lang.String region
public static final java.awt.Color defaultColor
public static final int sizeSmall
public static final java.lang.String SLICE_NODE_PREFIX
private boolean isSliceNode
Constructor Detail |
---|
public Node(java.lang.Integer id, Position position, java.lang.Double weightColor, java.lang.Double weightSize)
Node
with the arguments.
The members hostname and ip are set to null
.
id
- an Integer
representing the node's idposition
- the Position
of the nodeweightColor
- a Double
that contains the value to be
attributed to the node's colorweightSize
- a Double
that contains the value to be
attributed to the node's sizepublic 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)
Node
with the arguments.
The members hostname and ip are set to null
.
id
- an Integer
representing the node's idposition
- the Position
of the nodeweightColor
- a Double
that contains the value to be
attributed to the node's colorweightSize
- a Double
that contains the value to be
attributed to the node's sizecity
- name of the nearest city to positionpublic Node()
Node
and initializes all members to null
.
Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Integer getId()
public Position getPosition()
public java.lang.String toString()
Node
. This is for
debugging purposes only.
toString
in class java.lang.Object
Node
public void setId(java.lang.Integer id)
id
- the id to setpublic void setPosition(Position position)
position
- the position to setpublic java.lang.String getHostname()
public void setHostname(java.lang.String hostname)
hostname
- the hostname to setpublic java.lang.String getIp()
public void setIp(java.lang.String ip)
ip
- the ip to setpublic java.lang.String getCity()
public void setCity(java.lang.String city)
city
- the city to setpublic java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- the color to setpublic java.lang.String getCountry()
public void setCountry(java.lang.String country)
country
- the country to setpublic java.lang.String getRegion()
public void setRegion(java.lang.String region)
region
- the region to setpublic Node clone() throws java.lang.CloneNotSupportedException
clone
in class MapComponent
java.lang.CloneNotSupportedException
public void copyValuesToNode(Node destNode)
destNode
- public boolean isSliceNode()
public void setSliceNode(boolean isSliceNode)
public int getSize()
public void setSize(int size)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |