gishur.graph.core
Class Flow

java.lang.Object
  |
  +--gishur.graph.core.Flow

public class Flow
extends java.lang.Object
implements java.io.Serializable, ToInfoString

Public inner class to represent the data of an Edge in a FlowNetwork. It stores the values for lower and upper capacity bounds, the actually set flow value and a flag which activates and deactivates the check of new flow values for validity.

See Also:
Serialized Form

Constructor Summary
Flow(double ucap, double lcap, double flow, boolean check)
          Constructor returning a new flow data set with the given values (see Edge#setFlowData()).
 
Method Summary
 boolean check()
          Returns true if capacity check is active, and false otherwise.
 double flow()
          Returns the actually set flow value.
 double lowerCapacity()
          Returns the actually set value for the lower capacity bound.
 boolean setCheck(boolean check)
          Activates / Deactivates Capacity checks.
 void setFlow(double flow)
          Sets the flow value to flow after having checked it for validity, if necessary.
 void setLowerCapacity(double lcap)
          Sets the given lcap value as new lower capacity bound or throws a GraphException if capacity check is activated and the set flow value would become invalid by the new lower bound.
 void setUpperCapacity(double ucap)
          Sets the given ucap value as new upper capacity bound or throws a GraphException if capacity check is activated and the set flow value would become invalid by the new upper bound.
 java.lang.String toInfoString()
          Returns an info String that can be used at Info-Boxes.
 java.lang.String toString()
          Overrides java.lang.Object.toString().
 double upperCapacity()
          Returns the set value for the upper capacity bound.
 boolean valid()
          Returns true if the actually set flow value lies between the set upper and lower bound.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Flow

public Flow(double ucap,
            double lcap,
            double flow,
            boolean check)
Constructor returning a new flow data set with the given values (see Edge#setFlowData()).
Method Detail

toString

public java.lang.String toString()
Overrides java.lang.Object.toString().
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

toInfoString

public java.lang.String toInfoString()
Returns an info String that can be used at Info-Boxes.
Specified by:
toInfoString in interface ToInfoString
Returns:
an info String that can be used at Info-Boxes.

setFlow

public void setFlow(double flow)
Sets the flow value to flow after having checked it for validity, if necessary.

flow

public double flow()
Returns the actually set flow value.

valid

public boolean valid()
Returns true if the actually set flow value lies between the set upper and lower bound.

setUpperCapacity

public void setUpperCapacity(double ucap)
Sets the given ucap value as new upper capacity bound or throws a GraphException if capacity check is activated and the set flow value would become invalid by the new upper bound.

upperCapacity

public double upperCapacity()
Returns the set value for the upper capacity bound.

setLowerCapacity

public void setLowerCapacity(double lcap)
Sets the given lcap value as new lower capacity bound or throws a GraphException if capacity check is activated and the set flow value would become invalid by the new lower bound.

lowerCapacity

public double lowerCapacity()
Returns the actually set value for the lower capacity bound.

setCheck

public boolean setCheck(boolean check)
Activates / Deactivates Capacity checks.
Parameters:
check - the value vor check

check

public boolean check()
Returns true if capacity check is active, and false otherwise.