UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.graphs
Class Edge

java.lang.Object
  |
  +--edu.berkeley.guir.lib.graphs.Edge
All Implemented Interfaces:
GraphConst, Serializable

public class Edge
extends Object
implements GraphConst, Serializable

A single directed Edge in a graph.

This software is distributed under the Berkeley Software License.

 Revisions:  - GUIRLib-v1.0-1.0.0, Nov 04 1997, JH
               Created class
             - GUIRLib-v1.0-1.1.0, Feb 24 2000, JH
               Updated for JDK1.3RC1 to use the Collections
             - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH
               Touched for GUIRLib release
 

Since:
1.1.4
Version:
GUIRLib-v1.4-1.0.0, Aug 31 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu)
See Also:
Serialized Form

Fields inherited from interface edu.berkeley.guir.lib.graphs.GraphConst
DEFAULT_NUMBER_EDGES, DEFAULT_NUMBER_NODES, DEFAULT_PATH_SIZE, DEFAULT_WEIGHT, ERROR, TRUE
 
Constructor Summary
Edge(Node nodeSrc, Node nodeDst)
          Constructor to create an Edge from a Node to another Node with a weight of GraphConst.DEFAULT_WEIGHT.
Edge(Node nodeSrc, Node nodeDst, float weight)
          Constructor to create an Edge from a Node to another Node with the specified weight.
Edge(String strNodeSrc, String strNodeDst)
          Constructor to create an Edge from a Node to another Node with a weight of GraphConst.DEFAULT_WEIGHT.
Edge(String strNodeSrc, String strNodeDst, float weight)
          Constructor to create an Edge from a Node to another Node with the specified weight.
 
Method Summary
 boolean equals(Object o)
          This method checks if a given object is the "same" as this one.
 Node getDestNode()
          Get the destination Node of the Edge.
 Node getSourceNode()
          Get the source Node of the Edge.
 float getWeight()
           
 int hashCode()
          Get a hashcode for this Edge.
 String toString()
          Returns the name of the Edge.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Edge

public Edge(String strNodeSrc,
            String strNodeDst)
Constructor to create an Edge from a Node to another Node with a weight of GraphConst.DEFAULT_WEIGHT.
Parameters:
strNodeSrc - is the name of the source Node.
strNodeDst - is the name of the destination Node.
See Also:
GraphConst

Edge

public Edge(String strNodeSrc,
            String strNodeDst,
            float weight)
Constructor to create an Edge from a Node to another Node with the specified weight.
Parameters:
strNodeSrc - is the name of the source Node.
strNodeDst - is the name of the destination Node.
weight - is the weight of the Edge.

Edge

public Edge(Node nodeSrc,
            Node nodeDst)
Constructor to create an Edge from a Node to another Node with a weight of GraphConst.DEFAULT_WEIGHT.
Parameters:
nodeSrc - is the source Node.
nodeDst - is the destination Node.
See Also:
GraphConst

Edge

public Edge(Node nodeSrc,
            Node nodeDst,
            float weight)
Constructor to create an Edge from a Node to another Node with the specified weight.
Parameters:
nodeSrc - is the source Node.
nodeDst - is the destination Node.
weight - is the weight of the Edge.
Method Detail

getSourceNode

public Node getSourceNode()
Get the source Node of the Edge.

getDestNode

public Node getDestNode()
Get the destination Node of the Edge.

getWeight

public float getWeight()

hashCode

public int hashCode()
Get a hashcode for this Edge.
Overrides:
hashCode in class Object
Returns:
Returns an int containing the hashcode for this Edge.

toString

public String toString()
Returns the name of the Edge.
Overrides:
toString in class Object

equals

public boolean equals(Object o)
This method checks if a given object is the "same" as this one. If the two Edges have the same name, then they are considered the same.
Overrides:
equals in class Object
Parameters:
obj - is the Object to check for equality.

Copyright Information