drasys.or.graph
Class VertexBase

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

public abstract class VertexBase
extends java.lang.Object
implements VertexI, java.io.Serializable

A common base for vertices containing common attributes.

See Also:
Serialized Form

Method Summary
 double getCost()
          If the value object is a 'VertexValueI' the return value is 'value.getCost()'.
 double[] getDemand()
          If the value object is a 'VertexValueI' the return value is 'value.getDemand()'.
 int getInDegree()
          Get the number of edges that are connected to this vertex on the 'to' end.
 int getIndex()
          The index of the vertex in the graph.
 java.lang.Object getKey()
          Returns the vertex key.
 int getOutDegree()
          Get the number of edges that are connected to this vertex on the 'from' end.
 double getTime()
          If the value object is a 'VertexValueI' the return value is 'value.getCost()'.
 java.lang.Object getValue()
          Returns the vertex value.
 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: VertexI
The index of the vertex in the graph. All vertices are numbered sequentially starting at zero.
Specified by:
getIndex in interface VertexI

getInDegree

public int getInDegree()
Description copied from interface: VertexI
Get the number of edges that are connected to this vertex on the 'to' end.
Specified by:
getInDegree in interface VertexI

getOutDegree

public int getOutDegree()
Description copied from interface: VertexI
Get the number of edges that are connected to this vertex on the 'from' end.
Specified by:
getOutDegree in interface VertexI

getKey

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

getValue

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

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)

getDemand

public double[] getDemand()
If the value object is a 'VertexValueI' the return value is 'value.getDemand()'. If the value object is a 'DoubleI' or 'Number' the return value is 'value.doubleValue()'. Otherwise; the return value is '0.0'.

getCost

public double getCost()
If the value object is a 'VertexValueI' the return value is 'value.getCost()'. Otherwise; the return value is '0.0'.

getTime

public double getTime()
If the value object is a 'VertexValueI' the return value is 'value.getCost()'. Otherwise; the return value is '0.0'.


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