jreversepro.runtime
Class Operand

java.lang.Object
  extended by jreversepro.runtime.Operand
All Implemented Interfaces:
OperandConstants

public class Operand
extends java.lang.Object
implements OperandConstants

Abstraction of an element on the JVM Operand stack.

Author:
Karthik Kumar

Field Summary
 
Fields inherited from interface jreversepro.runtime.OperandConstants
L_ADD, L_BITAND, L_BITOR, L_BITXOR, L_CAST, L_COMMA, L_DIV, L_EVAL, L_INDEX, L_LOGAND, L_LOGEQ, L_LOGIOF, L_LOGNEQ, L_LOGOR, L_LOGREL, L_MOD, L_MUL, L_REF, L_SHIFT, L_SUB, L_TERN, L_UNARY, VALUE
 
Constructor Summary
Operand(int value, java.lang.String datatype, int precedence)
           
Operand(java.lang.String value, java.lang.String datatype, int precedence)
           
 
Method Summary
 java.lang.String getDatatype()
           
 int getPrecedence()
           
 java.lang.String getValue()
           
 java.lang.String getValueEx(int precedence)
           
 boolean isCategory1()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operand

public Operand(java.lang.String value,
               java.lang.String datatype,
               int precedence)
Parameters:
value - Value in String.
datatype - Datatype of the operand.
precedence - precedence of the operand.

Operand

public Operand(int value,
               java.lang.String datatype,
               int precedence)
Parameters:
value - Value int.
datatype - Datatype of the operand.
precedence - precedence of the operand.
Method Detail

getValue

public java.lang.String getValue()
Returns:
Returns the value

getValueEx

public java.lang.String getValueEx(int precedence)
Parameters:
precedence - precedence of the operand.
Returns:
Returns value taking into account precendence too,

getDatatype

public java.lang.String getDatatype()
Returns:
Returns datatype.

getPrecedence

public int getPrecedence()
Returns:
Returns precedence.

isCategory1

public boolean isCategory1()
Returns:
Returns true, if this type is one of the following. integer, boolean, byte, character, short, float, reference, return address. In case it is either Long / Double the datatype belongs to cat2

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Stringified format of this.


Submit Feedback to akkumar@users.sourceforge.net