drasys.or.graph
Class EdgeValue

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

public class EdgeValue
extends java.lang.Object
implements EdgeValueI, java.io.Serializable

A object which can hold generic edge values.

See Also:
Serialized Form

Constructor Summary
EdgeValue()
           
EdgeValue(double cost, double time, double distance)
          Constructs a new edge value object with explicit values.
EdgeValue(EdgeValueI value)
          Constructs a new edge value object with explicit values.
 
Method Summary
 double getCost(boolean reverse)
          Returns the cost of crossing the edge in the indicated direction.
 double getDistance(boolean reverse)
          Returns the distance across the edge in the indicated direction.
 double getTime(boolean reverse)
          Returns the time required to cross the edge in the indicated direction.
 void set(double cost, double time, double distance)
          Sets the default values for the edge.
 void setCost(boolean reverse, double cost)
          Sets the cost of crossing the edge in the indicated direction.
 void setDistance(boolean reverse, double distance)
          Sets the distance across the edge in the indicated direction.
 void setTime(boolean reverse, double time)
          Sets the time to cross the edge in the indicated direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeValue

public EdgeValue()

EdgeValue

public EdgeValue(EdgeValueI value)
Constructs a new edge value object with explicit values.

EdgeValue

public EdgeValue(double cost,
                 double time,
                 double distance)
Constructs a new edge value object with explicit values.
Method Detail

getCost

public double getCost(boolean reverse)
Returns the cost of crossing the edge in the indicated direction.
Specified by:
getCost in 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 reverse)
Returns the time required to cross the edge in the indicated direction.
Specified by:
getTime in 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 reverse)
Returns the distance across the edge in the indicated direction.
Specified by:
getDistance in 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.

set

public void set(double cost,
                double time,
                double distance)
Sets the default values for the edge.

setCost

public void setCost(boolean reverse,
                    double cost)
Sets the cost of crossing the edge in the indicated direction.
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.

setTime

public void setTime(boolean reverse,
                    double time)
Sets the time to cross the edge in the indicated direction.
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.

setDistance

public void setDistance(boolean reverse,
                        double distance)
Sets the distance across the edge in the indicated direction.
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.


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