Class AbsExtendedPrimitive

    • Field Detail

    • Constructor Detail

      • AbsExtendedPrimitive

        public AbsExtendedPrimitive​(String typeName)
        Construct an Abstract descriptor to hold a extended-primitive of the proper type (e.g. java.math.BigInteger...).
        Parameters:
        typeName - The name of the type of the extended-primitive held by this descriptor.
    • Method Detail

      • wrap

        public static AbsExtendedPrimitive wrap​(Object value)
        Create an AbsExtendedPrimitive of type value.getClass() containing a given value.
      • set

        public void set​(Object value)
        Set the value of this AbsExtendedPrimitive to the given value.
        Parameters:
        value - The new value
        Throws:
        IllegalArgumentException - If the type of this AbsExtendedPrimitive is not correct.
      • get

        public Object get()
        Returns:
        the value of this AbsExtendedPrimitive.
      • getTypeName

        public String getTypeName()
        Specified by:
        getTypeName in interface AbsObject
        Returns:
        The name of the type of the object held by this abstract descriptor.
      • getAbsObject

        public AbsObject getAbsObject​(String name)
        Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return null
        Specified by:
        getAbsObject in interface AbsObject
        Parameters:
        name - The name of the attribute.
        Returns:
        value The value of the attribute.
      • getNames

        public String[] getNames()
        Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return null
        Specified by:
        getNames in interface AbsObject
        Returns:
        the name of all attributes.
      • isGrounded

        public boolean isGrounded()
        Tests if this AbsExtendedPrimitive is grounded. It always returns true
        Specified by:
        isGrounded in interface AbsObject
        Returns:
        true if the object is grounded.
      • getCount

        public int getCount()
        Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return 0
        Specified by:
        getCount in interface AbsObject
        Returns:
        the number of attributes.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object