org.ujac.util.exi
Class VariableOperand

java.lang.Object
  extended by org.ujac.util.exi.Operand
      extended by org.ujac.util.exi.VariableOperand
All Implemented Interfaces:
Serializable, Cloneable

public class VariableOperand
extends Operand

Name: VariableOperand
Description: A class implementing operands holding variables.

Author:
lauerc
See Also:
Serialized Form

Constructor Summary
VariableOperand()
          Constructs a VariableOperand instance with specific attributes.
VariableOperand(char[] source, int absolutePosition, int relativePosition, int length)
          Constructs an VariableOperand instance with specific arguments.
VariableOperand(Operand outer)
          Constructs an VariableOperand instance with specific arguments.
 
Method Summary
 Object clone()
           
 Object getObject()
          Returns the object, connected to the variable.
 Object getValue()
          Gets the operand value.
 String getVariable()
          Returns the variable.
 boolean isNegative()
          Tells whether the variable is signed negative or not.
 boolean isSimple()
          Tells whether the operand is a simple one or not.
 void setNegative(boolean negative)
          Sets the negative flag for the variable.
 void setObject(Object object)
          Sets the object, connected to the variable.
 void setVariable(String variable)
          Sets the variable.
 String toString()
           
 
Methods inherited from class org.ujac.util.exi.Operand
getAbsolutePosition, getCode, getForcedType, getLength, getRelativePosition, getSource, getTotalLength, getTotalPosition, setAbsolutePosition, setForcedType, setLength, setRelativePosition, setSource, setTotalLength, setTotalPosition
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableOperand

public VariableOperand()
Constructs a VariableOperand instance with specific attributes.


VariableOperand

public VariableOperand(char[] source,
                       int absolutePosition,
                       int relativePosition,
                       int length)
Constructs an VariableOperand instance with specific arguments.

Parameters:
source - The textual source for the expression.
absolutePosition - The absolute start position of the expression within the source.
relativePosition - The relative start position of the expression within the source.
length - The length of the expression.

VariableOperand

public VariableOperand(Operand outer)
Constructs an VariableOperand instance with specific arguments. Copies the source, totalPosition and totalLength from the outer expression.

Parameters:
outer - The outer expression.
Method Detail

isSimple

public boolean isSimple()
Description copied from class: Operand
Tells whether the operand is a simple one or not.

Specified by:
isSimple in class Operand
Returns:
true if the operand is instance of class VariableOperand else false.
See Also:
Operand.isSimple()

getVariable

public String getVariable()
Returns the variable.

Returns:
The variable name.

setVariable

public void setVariable(String variable)
Sets the variable.

Parameters:
variable - The variable to set

getObject

public Object getObject()
Returns the object, connected to the variable.

Returns:
The object's value.

setObject

public void setObject(Object object)
Sets the object, connected to the variable.

Parameters:
object - The object to set

isNegative

public boolean isNegative()
Tells whether the variable is signed negative or not.

Returns:
true if the variable is signed negative, else false.

setNegative

public void setNegative(boolean negative)
Sets the negative flag for the variable.

Parameters:
negative - true if the variable shall be signed negative, else false.

getValue

public Object getValue()
Gets the operand value.

Specified by:
getValue in class Operand
Returns:
the value of the operand.

toString

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

clone

public Object clone()
Overrides:
clone in class Operand
See Also:
Object.clone()


Copyright © 2003-2004 UJAC.org. All Rights Reserved.