FileDocCategorySizeDatePackage
BasicValue.javaAPI DocGlassfish v2 API3586Thu Mar 02 11:51:16 GMT 2006oracle.toplink.libraries.asm.tree.analysis

BasicValue

public class BasicValue extends Object implements Value
A {@link 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

Fields Summary
public static final Value
UNINITIALIZED_VALUE
public static final Value
INT_VALUE
public static final Value
FLOAT_VALUE
public static final Value
LONG_VALUE
public static final Value
DOUBLE_VALUE
public static final Value
REFERENCE_VALUE
public static final Value
RETURNADDRESS_VALUE
private Type
type
Constructors Summary
public BasicValue(Type type)

  
       
    this.type = type;
  
Methods Summary
public booleanequals(Value value)

    if (value == this) {
      return true;
    } else if (value instanceof BasicValue) {
      if (type == null) {
        return ((BasicValue)value).type == null; 
      } else {
        return type.equals(((BasicValue)value).type);
      }
    } else {
      return false;
    }
  
public intgetSize()

    return type == Type.LONG_TYPE || type == Type.DOUBLE_TYPE ? 2 : 1;
  
public oracle.toplink.libraries.asm.TypegetType()

    return type;
  
public booleanisReference()

    return type != null && (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY);
  
public java.lang.StringtoString()

    if (this == UNINITIALIZED_VALUE) {
      return ".";
    } else if (this == RETURNADDRESS_VALUE) {
      return "A";
    } else if (this == REFERENCE_VALUE) {
      return "R";
    } else {
      return type.getDescriptor();
    }