graph
Class Edge

java.lang.Object
  extended bygraph.Edge
All Implemented Interfaces:
java.lang.Comparable

public class Edge
extends java.lang.Object
implements java.lang.Comparable


Constructor Summary
Edge(Node src, Node dst)
          Initializes the Edge with given source and destination nodes.
Edge(java.lang.String label, Node src, Node dst)
          Initializes the Edge with given label and source and destination nodes.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 Node dest()
          Returns the destination node of the edge.
 java.lang.String get(java.lang.String property)
          Returns the value for the given property of the edge
 double getDouble(java.lang.String property)
          Returns the value for the given property of the edge
 int getInt(java.lang.String property)
          Returns the value for the given property of the edge
 java.lang.String label()
          Returns the label of the edge
 void set(java.lang.String property, java.lang.String value)
          Sets the given property of the edge to given value
 void setDouble(java.lang.String property, double value)
          Sets the given property of the edge to given value
 void setInt(java.lang.String property, int value)
          Sets the given property of the edge to given value
 Node source()
          Returns the source node of the edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Edge

public Edge(java.lang.String label,
            Node src,
            Node dst)
Initializes the Edge with given label and source and destination nodes.

Parameters:
label - the label of the edge
src - source Node of the edge
dst - destination Node of the edge

Edge

public Edge(Node src,
            Node dst)
Initializes the Edge with given source and destination nodes.

Parameters:
src - source Node of the edge
dst - destination Node of the edge
Method Detail

source

public Node source()
Returns the source node of the edge.

Returns:
the source Node

dest

public Node dest()
Returns the destination node of the edge.

Returns:
the destination Node

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

label

public java.lang.String label()
Returns the label of the edge

Returns:
a String containing the label of the edge or null, if the edge does not have one.

set

public void set(java.lang.String property,
                java.lang.String value)
Sets the given property of the edge to given value

Parameters:
property - a String containing property for which the value is set
value - a String containing the new value for the property

setInt

public void setInt(java.lang.String property,
                   int value)
Sets the given property of the edge to given value

Parameters:
property - a String containing property for which the value is set
value - an integer containing the new value for the property

setDouble

public void setDouble(java.lang.String property,
                      double value)
Sets the given property of the edge to given value

Parameters:
property - a String containing property for which the value is set
value - a double containing the new value for the property

get

public java.lang.String get(java.lang.String property)
Returns the value for the given property of the edge

Parameters:
property - a String containing the requested property
Returns:
a String containing the current value of the property, or null, if the property does not exist

getInt

public int getInt(java.lang.String property)
           throws java.lang.NumberFormatException
Returns the value for the given property of the edge

Parameters:
property - a String containing the requested property
Returns:
an integer containing the current value of the property, or -1, if the property does not exist
Throws:
java.lang.NumberFormatException

getDouble

public double getDouble(java.lang.String property)
                 throws java.lang.NumberFormatException
Returns the value for the given property of the edge

Parameters:
property - a String containing the requested property
Returns:
a double containing the current value of the property, or -1, if the property does not exist
Throws:
java.lang.NumberFormatException