Top Description Fields Constructors Methods
org.objectweb.asm.tree.analysis

public Class BasicValue

extends Object
implements Value
Class Inheritance
All Implemented Interfaces
org.objectweb.asm.tree.analysis.Value
Imports
org.objectweb.asm.Type

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

Field Summary

Modifier and TypeField and Description
public static final BasicValue
DOUBLE_VALUE

A double value.

public static final BasicValue
FLOAT_VALUE

A float value.

public static final BasicValue
INT_VALUE

A byte, boolean, char, short, or int value.

public static final BasicValue
LONG_VALUE

A long value.

public static final BasicValue
REFERENCE_VALUE

An object or array reference value.

public static final BasicValue
RETURNADDRESS_VALUE

A return address value (produced by a jsr instruction).

private final Type
type

The Type of this value, or null for uninitialized values.

public static final BasicValue
UNINITIALIZED_VALUE

An uninitialized value.

Constructor Summary

AccessConstructor and Description
public
BasicValue(final Type
the value type.
type
)

Constructs a new BasicValue of the given type.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(final Object
the reference object with which to compare.
value
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
getSize()

Implements org.objectweb.asm.tree.analysis.Value.getSize.

Returns the size of this value in 32 bits words.
public Type

Returns:

the Type of this value.
getType
()

Returns the Type of this value.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public boolean

Returns:

whether this value corresponds to an object or array reference.
isReference
()

Returns whether this value corresponds to an object or array reference.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

DOUBLE_VALUEback to summary
public static final BasicValue DOUBLE_VALUE

A double value.

FLOAT_VALUEback to summary
public static final BasicValue FLOAT_VALUE

A float value.

INT_VALUEback to summary
public static final BasicValue INT_VALUE

A byte, boolean, char, short, or int value.

LONG_VALUEback to summary
public static final BasicValue LONG_VALUE

A long value.

REFERENCE_VALUEback to summary
public static final BasicValue REFERENCE_VALUE

An object or array reference value.

RETURNADDRESS_VALUEback to summary
public static final BasicValue RETURNADDRESS_VALUE

A return address value (produced by a jsr instruction).

typeback to summary
private final Type type

The Type of this value, or null for uninitialized values.

UNINITIALIZED_VALUEback to summary
public static final BasicValue UNINITIALIZED_VALUE

An uninitialized value.

Constructor Detail

BasicValueback to summary
public BasicValue(final Type type)

Constructs a new BasicValue of the given type.

Parameters
type:Type

the value type.

Method Detail

equalsback to summary
public boolean equals(final Object value)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
value:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getSizeback to summary
public int getSize()

Implements org.objectweb.asm.tree.analysis.Value.getSize.

Doc from org.objectweb.asm.tree.analysis.Value.getSize.

Returns the size of this value in 32 bits words. This size should be 1 for byte, boolean, char, short, int, float, object and array types, and 2 for long and double.

Returns:int

either 1 or 2.

Annotations
@Override
getTypeback to summary
public Type getType()

Returns the Type of this value.

Returns:Type

the Type of this value.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isReferenceback to summary
public boolean isReference()

Returns whether this value corresponds to an object or array reference.

Returns:boolean

whether this value corresponds to an object or array reference.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override