main
Class SophiaNodesEdgesMap

java.lang.Object
  extended by main.SophiaNodesEdgesMap
All Implemented Interfaces:
NodeEdgeMap

public class SophiaNodesEdgesMap
extends java.lang.Object
implements NodeEdgeMap

The SophiaNodesEdgesMap class stores a collection of nodes and edges representing properties of the PlanetLab network. This class contains methods that receive information from the DataGatherer and store it as nodes and edges.


Field Summary
private  java.util.ArrayList<Edge> edges
           
private  java.util.ArrayList<DrawableLabel> labels
           
private  java.util.ArrayList<Node> nodes
           
 
Constructor Summary
SophiaNodesEdgesMap(java.lang.String nodeResults, java.lang.String edgeResults)
          Creates a new SophiaNodesEdgesMap from a DataGatherer.
 
Method Summary
 java.util.ArrayList<Edge> getEdges()
          Returns an ArrayList of Edges that represent pairs PlanetLab of computers and properties of interactions between them.
 java.util.ArrayList<DrawableLabel> getLabels()
          Returns an ArrayList of DrawableLabels that represent text-labels that can be drawn on the map.
 java.util.ArrayList<Node> getNodes()
          Returns an ArrayList of Nodes that represent PlanetLab computers and their properties.
private  void parseAndSetEdges(java.lang.String edgeResults)
           
private  void parseAndSetNodes(java.lang.String nodeResults)
           
private  java.util.StringTokenizer parseQuery(java.lang.String results)
           
private  java.lang.Double returnDoubleParameter(java.lang.String value)
           
private  java.lang.Integer returnIntegerParameter(java.lang.String value)
           
 java.lang.String toString()
          Returns a string representation of the SophiaNodesEdgesMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodes

private java.util.ArrayList<Node> nodes

edges

private java.util.ArrayList<Edge> edges

labels

private java.util.ArrayList<DrawableLabel> labels
Constructor Detail

SophiaNodesEdgesMap

public SophiaNodesEdgesMap(java.lang.String nodeResults,
                           java.lang.String edgeResults)
                    throws java.text.ParseException
Creates a new SophiaNodesEdgesMap from a DataGatherer. Stores the nodes and edges in the map by parsing the information stored in the DataGatherer.

Parameters:
nodeResults - a String that contains the node result of a Sophia node query
edgeResults - a String that contains the edge result of a Sophia edge query
Throws:
java.text.ParseException - if a parse error occurs
Method Detail

getNodes

public java.util.ArrayList<Node> getNodes()
Description copied from interface: NodeEdgeMap
Returns an ArrayList of Nodes that represent PlanetLab computers and their properties.

Specified by:
getNodes in interface NodeEdgeMap

getLabels

public java.util.ArrayList<DrawableLabel> getLabels()
Description copied from interface: NodeEdgeMap
Returns an ArrayList of DrawableLabels that represent text-labels that can be drawn on the map.

Specified by:
getLabels in interface NodeEdgeMap

getEdges

public java.util.ArrayList<Edge> getEdges()
Description copied from interface: NodeEdgeMap
Returns an ArrayList of Edges that represent pairs PlanetLab of computers and properties of interactions between them.

Specified by:
getEdges in interface NodeEdgeMap

parseAndSetNodes

private void parseAndSetNodes(java.lang.String nodeResults)
                       throws java.text.ParseException
Throws:
java.text.ParseException

parseAndSetEdges

private void parseAndSetEdges(java.lang.String edgeResults)
                       throws java.text.ParseException
Throws:
java.text.ParseException

parseQuery

private java.util.StringTokenizer parseQuery(java.lang.String results)

returnDoubleParameter

private java.lang.Double returnDoubleParameter(java.lang.String value)
                                        throws java.text.ParseException
Throws:
java.text.ParseException

returnIntegerParameter

private java.lang.Integer returnIntegerParameter(java.lang.String value)
                                          throws java.text.ParseException
Throws:
java.text.ParseException

toString

public java.lang.String toString()
Returns a string representation of the SophiaNodesEdgesMap.

Overrides:
toString in class java.lang.Object