SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.graph
Class Edge

java.lang.Object
  |
  +--com.solarmetric.rd.graph.Edge

public class Edge
extends java.lang.Object

A graph edge. Includes the from and to nodes, an arbitrary user object, and a weight. Edges can be either directed or undirected.


Constructor Summary
Edge(java.lang.Object from, java.lang.Object to, boolean directed)
          Constructor.
 
Method Summary
 java.lang.Object getFrom()
          Return the node the edge links from.
 java.lang.Object getOther(java.lang.Object node)
          Return the node on the opposite end of the given one, or null if the given node is not part of this edge.
 java.lang.Object getTo()
          Return the node the edge links to.
 java.lang.Object getUserObject()
          Arbitrary user object associated with the edge.
 double getWeight()
          Return the weight of the edge.
 boolean isDirected()
          Return whether the edge is directed.
 boolean isFrom(java.lang.Object node)
          Return true if this edge links from the given node.
 boolean isTo(java.lang.Object node)
          Return true if this edge links to the given node.
 void setUserObject(java.lang.Object obj)
          Arbitrary user object associated with the edge.
 void setWeight(double weight)
          Set the weight 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.Object from,
            java.lang.Object to,
            boolean directed)
Constructor.

Parameters:
from - the node the edge comes from
to - the node the edge goes to
directed - whether the edge is directed
Method Detail

getFrom

public java.lang.Object getFrom()
Return the node the edge links from.


getTo

public java.lang.Object getTo()
Return the node the edge links to.


getOther

public java.lang.Object getOther(java.lang.Object node)
Return the node on the opposite end of the given one, or null if the given node is not part of this edge.


isTo

public boolean isTo(java.lang.Object node)
Return true if this edge links to the given node. For undirected edges, this method returns true if either side is equal to the given node.


isFrom

public boolean isFrom(java.lang.Object node)
Return true if this edge links from the given node. For undirected edges, this method returns true if either side is equal to the given node.


isDirected

public boolean isDirected()
Return whether the edge is directed.


getWeight

public double getWeight()
Return the weight of the edge.


setWeight

public void setWeight(double weight)
Set the weight of the edge.


getUserObject

public java.lang.Object getUserObject()
Arbitrary user object associated with the edge.


setUserObject

public void setUserObject(java.lang.Object obj)
Arbitrary user object associated with the edge.


SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.