drasys.or.graph
Class EdgeBase

java.lang.Object
  |
  +--drasys.or.graph.EdgeBase

public abstract class EdgeBase
extends java.lang.Object
implements EdgeI, java.io.Serializable

A common base for edges containing common attributes.

See Also:
Serialized Form

Method Summary
 double getCost(boolean isReverse)
          If the value object is a 'EdgeValueI' the return value is 'value.getCost(isReverse)'.
 double getDistance(boolean isReverse)
          If the value object is an 'EdgeValueI' the return value is 'value.getDistance(isReverse)'.
 int getIndex()
          The index of the edge in the graph.
 java.lang.Object getKey()
          Returns the edge key.
 GraphI getSubgraph()
          Always returns null.
 double getTime(boolean isReverse)
          If the value object is an 'EdgeValueI' the return value is 'value.getTime(isReverse)'.
 java.lang.Object getValue()
          Returns the edge value.
 boolean isDirected()
          Returns true if the edge is directed.
 boolean isEdge()
          Returns true if the graph element is an edge.
 boolean isVertex()
          Returns true if the graph element is a vertex.
 void setIndex(int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIndex

public int getIndex()
Description copied from interface: EdgeI
The index of the edge in the graph. All edges are numbered sequentially starting at zero.
Specified by:
getIndex in interface EdgeI

getKey

public java.lang.Object getKey()
Description copied from interface: EdgeI
Returns the edge key.
Specified by:
getKey in interface EdgeI

getValue

public java.lang.Object getValue()
Description copied from interface: EdgeI
Returns the edge value.
Specified by:
getValue in interface EdgeI

isEdge

public boolean isEdge()
Description copied from interface: ElementI
Returns true if the graph element is an edge.

isVertex

public boolean isVertex()
Description copied from interface: ElementI
Returns true if the graph element is a vertex.

setIndex

public void setIndex(int index)

isDirected

public boolean isDirected()
Description copied from interface: EdgeI
Returns true if the edge is directed.
Specified by:
isDirected in interface EdgeI

getCost

public double getCost(boolean isReverse)
If the value object is a 'EdgeValueI' the return value is 'value.getCost(isReverse)'. If the value object is a 'DoubleI' or 'Number' the return value is 'value.doubleValue()'. Otherwise; the return value is '0.0'.
Tags copied from interface: EdgeValueI
Parameters:
reverse - is set to true if the traversal starts at the 'to' end of the edge and stops at the 'from' end, this can only happen if the edge is undirected.

getTime

public double getTime(boolean isReverse)
If the value object is an 'EdgeValueI' the return value is 'value.getTime(isReverse)'. Otherwise; the return value is '0.0'.
Tags copied from interface: EdgeValueI
Parameters:
reverse - is set to true if the traversal starts at the 'to' end of the edge and stops at the 'from' end, this can only happen if the edge is undirected.

getDistance

public double getDistance(boolean isReverse)
If the value object is an 'EdgeValueI' the return value is 'value.getDistance(isReverse)'. Otherwise; the return value is '0.0'.
Tags copied from interface: EdgeValueI
Parameters:
reverse - is set to true if the traversal starts at the 'to' end of the edge and stops at the 'from' end, this can only happen if the edge is undirected.

getSubgraph

public GraphI getSubgraph()
Always returns null.
Specified by:
getSubgraph in interface EdgeI


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com