org.objectweb.asm.tree.analysis
Class BasicValue

java.lang.Object
  extended byorg.objectweb.asm.tree.analysis.BasicValue
All Implemented Interfaces:
Value

public class BasicValue
extends Object
implements Value

A Value that is represented by its type in a seven types type sytem. This type system distinguishes the UNINITIALZED, INT, FLOAT, LONG, DOUBLE, REFERENCE and RETURNADDRESS types.

Author:
Eric Bruneton

Field Summary
static int DOUBLE
           
static Value DOUBLE_VALUE
           
static int FLOAT
           
static Value FLOAT_VALUE
           
static int INT
           
static Value INT_VALUE
           
static int LONG
           
static Value LONG_VALUE
           
static int REFERENCE
           
static Value REFERENCE_VALUE
           
static int RETURNADDRESS
           
static Value RETURNADDRESS_VALUE
           
static int UNINITIALIZED
           
static Value UNINITIALIZED_VALUE
           
 
Method Summary
 boolean equals(Value value)
          Compares this value with the given value.
 int getSize()
          Returns the size of this value in words.
 int getType()
           
 Value merge(Value value)
          Merges this value and the given value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNINITIALIZED

public static final int UNINITIALIZED
See Also:
Constant Field Values

INT

public static final int INT
See Also:
Constant Field Values

FLOAT

public static final int FLOAT
See Also:
Constant Field Values

LONG

public static final int LONG
See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
See Also:
Constant Field Values

REFERENCE

public static final int REFERENCE
See Also:
Constant Field Values

RETURNADDRESS

public static final int RETURNADDRESS
See Also:
Constant Field Values

UNINITIALIZED_VALUE

public static final Value UNINITIALIZED_VALUE

INT_VALUE

public static final Value INT_VALUE

FLOAT_VALUE

public static final Value FLOAT_VALUE

LONG_VALUE

public static final Value LONG_VALUE

DOUBLE_VALUE

public static final Value DOUBLE_VALUE

REFERENCE_VALUE

public static final Value REFERENCE_VALUE

RETURNADDRESS_VALUE

public static final Value RETURNADDRESS_VALUE
Method Detail

getType

public int getType()

getSize

public int getSize()
Description copied from interface: Value
Returns the size of this value in words.

Specified by:
getSize in interface Value
Returns:
either 1 or 2.

merge

public Value merge(Value value)
Description copied from interface: Value
Merges this value and the given value. The merge operation must return a value that represents both values (for instance, if the two values are two types, the merged value must be a common super type of the two types. If the two values are integer intervals, the merged value must be an interval that contains the previous ones. Likewise for other types of values).

Specified by:
merge in interface Value
Parameters:
value - a value.
Returns:
the merged value. If the merged value is equal to this value, this method must return this.

equals

public boolean equals(Value value)
Description copied from interface: Value
Compares this value with the given value.

Specified by:
equals in interface Value
Parameters:
value - a value.
Returns:
true if the values are equals, false otherwise.

toString

public String toString()