org.objectweb.medor.expression.lib

Class BasicOperand

Implemented Interfaces:
org.objectweb.medor.clone.api.Cloneable, Expression, Operand, Serializable
Known Direct Subclasses:
BasicVariableOperand

public class BasicOperand
extends BasicExpression
implements Operand

Author:
Sebastien Chassande-Barrioz

Field Summary

protected double
doubleValue
protected boolean
isDefined
protected long
longValue
protected Object
objectValue

Fields inherited from class org.objectweb.medor.expression.lib.BasicExpression

logger, type

Constructor Summary

BasicOperand()
BasicOperand(Date p)
BasicOperand(Object p, PType type)
BasicOperand(PType p)
BasicOperand(String p)
BasicOperand(boolean p)
BasicOperand(byte p)
BasicOperand(byte[] p)
BasicOperand(char p)
BasicOperand(char[] p)
BasicOperand(double p)
BasicOperand(float p)
BasicOperand(int p)
BasicOperand(long p)
BasicOperand(BasicOperand bo)
BasicOperand(short p)

Method Summary

Object
clone(Object clone, java.util.Map obj2clone)
Operand
compileExpression()
Checks the semantic integrity of an expression.
Operand
evaluate(ParameterOperand[] pos, Object o)
BigDecimal
getBigDecimal()
BigInteger
getBigInteger()
boolean
getBoolean()
byte
getByte()
byte[]
getByteArray()
char
getChar()
char[]
getCharArray()
Date
getDate()
double
getDouble()
float
getFloat()
int
getInt()
long
getLong()
Object
getObject()
short
getShort()
String
getString()
PType
getType()
It gets the result type of this expression
String
getValueAsString()
It retrieves the value of the operand as a String.
boolean
isDefined()
void
setIsDefined(boolean isdefined)
String
toString()

Methods inherited from class org.objectweb.medor.expression.lib.BasicExpression

clone, getType

Methods inherited from class org.objectweb.medor.clone.lib.BasicCloneable

clone, clone, clone, getClone

Field Details

doubleValue

protected double doubleValue


isDefined

protected boolean isDefined


longValue

protected long longValue


objectValue

protected Object objectValue

Constructor Details

BasicOperand

public BasicOperand()


BasicOperand

public BasicOperand(Date p)


BasicOperand

public BasicOperand(Object p,
                    PType type)


BasicOperand

protected BasicOperand(PType p)


BasicOperand

public BasicOperand(String p)


BasicOperand

public BasicOperand(boolean p)


BasicOperand

public BasicOperand(byte p)


BasicOperand

public BasicOperand(byte[] p)


BasicOperand

public BasicOperand(char p)


BasicOperand

public BasicOperand(char[] p)


BasicOperand

public BasicOperand(double p)


BasicOperand

public BasicOperand(float p)


BasicOperand

public BasicOperand(int p)


BasicOperand

public BasicOperand(long p)


BasicOperand

public BasicOperand(BasicOperand bo)


BasicOperand

public BasicOperand(short p)

Method Details

clone

public Object clone(Object clone,
                    java.util.Map obj2clone)
            throws CloneNotSupportedException
Specified by:
clone in interface org.objectweb.medor.clone.api.Cloneable
Overrides:
clone in interface BasicExpression


compileExpression

public Operand compileExpression()
Checks the semantic integrity of an expression. It checks that all types are compatible and prepare the expression to be evaluable.It also creates buffers where stores the result. Notes that when evaluating there is no creation of new objects. This method change the state of this expression object, it will be evaluable and not modifiable.
Specified by:
compileExpression in interface Expression


evaluate

public Operand evaluate(ParameterOperand[] pos,
                        Object o)
            throws ExpressionException


getBigDecimal

public BigDecimal getBigDecimal()
            throws TypingException
Specified by:
getBigDecimal in interface Operand


getBigInteger

public BigInteger getBigInteger()
            throws TypingException
Specified by:
getBigInteger in interface Operand


getBoolean

public boolean getBoolean()
            throws TypingException
Specified by:
getBoolean in interface Operand


getByte

public byte getByte()
            throws TypingException
Specified by:
getByte in interface Operand


getByteArray

public byte[] getByteArray()
            throws TypingException
Specified by:
getByteArray in interface Operand


getChar

public char getChar()
            throws TypingException
Specified by:
getChar in interface Operand


getCharArray

public char[] getCharArray()
            throws TypingException
Specified by:
getCharArray in interface Operand


getDate

public Date getDate()
            throws TypingException
Specified by:
getDate in interface Operand


getDouble

public double getDouble()
            throws TypingException
Specified by:
getDouble in interface Operand


getFloat

public float getFloat()
            throws TypingException
Specified by:
getFloat in interface Operand


getInt

public int getInt()
            throws TypingException
Specified by:
getInt in interface Operand


getLong

public long getLong()
            throws TypingException
Specified by:
getLong in interface Operand


getObject

public Object getObject()
Specified by:
getObject in interface Operand


getShort

public short getShort()
            throws TypingException
Specified by:
getShort in interface Operand


getString

public String getString()
            throws TypingException
Specified by:
getString in interface Operand


getType

public PType getType()
It gets the result type of this expression
Specified by:
getType in interface Expression
Overrides:
getType in interface BasicExpression

Returns:
a PType object


getValueAsString

public String getValueAsString()
It retrieves the value of the operand as a String.


isDefined

public boolean isDefined()
Specified by:
isDefined in interface Operand


setIsDefined

public void setIsDefined(boolean isdefined)
Specified by:
setIsDefined in interface Operand


toString

public String toString()