Java.problem
Class Variable

java.lang.Object
  extended by Java.problem.Variable

public class Variable
extends java.lang.Object

Description of a variable

Since:
1.0

Constructor Summary
Variable()
           
 
Method Summary
 void addPossibleReaction(PossibleReaction r)
          Add possible reaction r to the model space of this variable
 void addReaction(Reaction r)
          Add reaction r to this variable
 void emptyReactions()
          Set list of reactions to the empty list
 int getId()
          Get id of variable, numbered 0...N-1
 java.lang.String getName()
          Get name of variable
 int getNumberOfPossibleReactions()
          Get number of possible reactions assigned to the model space of this variable
 int getNumberOfReactions()
          Get number of reactions assigned to this variable
 PossibleReaction getPossibleReaction(int i)
          Get possible reaction i assigned to the model space of this variable
 Reaction getReaction(int i)
          Get reaction i assigned to this variable
 java.lang.String getType()
          Get type of variable; dependent or inputVariable
 boolean isDependent()
          Check if type of variable is dependent
 boolean isInputVariable()
          Check if type of variable is inputVariable
 int read(java.lang.String[] commands, java.io.BufferedReader in, int line_no, int debug)
          Read variable from input file in form of a buffered reader
 java.lang.String toString()
          Get string representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variable

public Variable()
Method Detail

read

public int read(java.lang.String[] commands,
                java.io.BufferedReader in,
                int line_no,
                int debug)
Read variable from input file in form of a buffered reader

Parameters:
commands - vector of strings on first line to read
in - buffered reader
line_no - current line in the buffered reader (i.e., problem file)
debug - debug level

isInputVariable

public boolean isInputVariable()
Check if type of variable is inputVariable

Returns:
true if inputVariable, ow false

isDependent

public boolean isDependent()
Check if type of variable is dependent

Returns:
true if dependent, ow false

getType

public java.lang.String getType()
Get type of variable; dependent or inputVariable

Returns:
the type

getId

public int getId()
Get id of variable, numbered 0...N-1

Returns:
the id

getName

public java.lang.String getName()
Get name of variable

Returns:
the name

getPossibleReaction

public PossibleReaction getPossibleReaction(int i)
Get possible reaction i assigned to the model space of this variable

Parameters:
i - the index
Returns:
the possible reaction i

getNumberOfPossibleReactions

public int getNumberOfPossibleReactions()
Get number of possible reactions assigned to the model space of this variable

Returns:
the number of reactions

addPossibleReaction

public void addPossibleReaction(PossibleReaction r)
Add possible reaction r to the model space of this variable

Parameters:
r - the reaction to add

getReaction

public Reaction getReaction(int i)
Get reaction i assigned to this variable

Parameters:
i - the index
Returns:
the reaction i

getNumberOfReactions

public int getNumberOfReactions()
Get number of reactions assigned to this variable

Returns:
the number of reactions

addReaction

public void addReaction(Reaction r)
Add reaction r to this variable

Parameters:
r - the reaction to add

emptyReactions

public void emptyReactions()
Set list of reactions to the empty list


toString

public java.lang.String toString()
Get string representation

Overrides:
toString in class java.lang.Object
Returns:
the string