org.ujac.util.exi
Class ConstantOperand

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

public class ConstantOperand
extends Operand

Name: ConstantOperand
Description: A class implementing operands holding constant values.

Author:
lauerc
See Also:
Serialized Form

Constructor Summary
ConstantOperand()
          Constructs a ConstantOperand instance with specific attributes.
ConstantOperand(char[] source, int absolutePosition, int relativePosition, int length)
          Constructs a ConstantOperand instance with specific attributes.
ConstantOperand(Operand outer)
          Constructs a ConstantOperand instance with specific attributes.
 
Method Summary
 Object clone()
           
 Object getObject()
          Returns the constant object.
 Object getValue()
          Gets the operand value.
 boolean isSimple()
          Tells whether the operand is a simple one or not.
 void setObject(Object object)
          Sets the constant object.
 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

ConstantOperand

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


ConstantOperand

public ConstantOperand(char[] source,
                       int absolutePosition,
                       int relativePosition,
                       int length)
Constructs a ConstantOperand instance with specific attributes.

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.

ConstantOperand

public ConstantOperand(Operand outer)
Constructs a ConstantOperand instance with specific attributes.

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()

getObject

public Object getObject()
Returns the constant object.

Returns:
The object's value.

setObject

public void setObject(Object object)
Sets the constant object.

Parameters:
object - The object to set

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.