Class BasicValue

  • All Implemented Interfaces:
    Value

    public class BasicValue
    extends java.lang.Object
    implements Value
    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.
    • Field Detail

      • UNINITIALIZED_VALUE

        public static final BasicValue UNINITIALIZED_VALUE
        An uninitialized value.
      • INT_VALUE

        public static final BasicValue INT_VALUE
        A byte, boolean, char, short, or int value.
      • FLOAT_VALUE

        public static final BasicValue FLOAT_VALUE
        A float value.
      • LONG_VALUE

        public static final BasicValue LONG_VALUE
        A long value.
      • DOUBLE_VALUE

        public static final BasicValue DOUBLE_VALUE
        A double value.
      • REFERENCE_VALUE

        public static final BasicValue REFERENCE_VALUE
        An object or array reference value.
      • RETURNADDRESS_VALUE

        public static final BasicValue RETURNADDRESS_VALUE
        A return address value (produced by a jsr instruction).
    • Constructor Detail

      • BasicValue

        public BasicValue​(Type type)
        Constructs a new BasicValue of the given type.
        Parameters:
        type - the value type.
    • Method Detail

      • getType

        public Type getType()
        Returns the Type of this value.
        Returns:
        the Type of this value.
      • getSize

        public int getSize()
        Description copied from interface: Value
        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.
        Specified by:
        getSize in interface Value
        Returns:
        either 1 or 2.
      • isReference

        public boolean isReference()
        Returns whether this value corresponds to an object or array reference.
        Returns:
        whether this value corresponds to an object or array reference.
      • equals

        public boolean equals​(java.lang.Object value)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object