jade.content.abs
Class AbsExtendedPrimitive

java.lang.Object
  extended by jade.content.abs.AbsExtendedPrimitive
All Implemented Interfaces:
AbsObject, AbsTerm, Term, java.io.Serializable

public class AbsExtendedPrimitive
extends java.lang.Object
implements AbsTerm

An extended abstract descriptor that can hold a generic primitive types (eg. java.math.BigDecimal) not supported by AbsPrimitive.

See Also:
Serialized Form

Field Summary
static int ABS_EXTENDED_PRIMITIVE
           
 
Fields inherited from interface jade.content.abs.AbsObject
ABS_AGENT_ACTION, ABS_AGGREGATE, ABS_CONCEPT, ABS_CONCEPT_SLOT_FUNCTION, ABS_CONTENT_ELEMENT_LIST, ABS_IRE, ABS_PREDICATE, ABS_PRIMITIVE, ABS_VARIABLE, UNKNOWN
 
Constructor Summary
AbsExtendedPrimitive(java.lang.String typeName)
          Construct an Abstract descriptor to hold a extended-primitive of the proper type (e.g. java.math.BigInteger...).
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Object get()
           
 AbsObject getAbsObject(java.lang.String name)
          Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return null
 int getAbsType()
           
 int getCount()
          Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return 0
 java.lang.String[] getNames()
          Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return null
 java.lang.String getTypeName()
           
 int hashCode()
           
 boolean isGrounded()
          Tests if this AbsExtendedPrimitive is grounded.
 void set(java.lang.Object value)
          Set the value of this AbsExtendedPrimitive to the given value.
 java.lang.String toString()
           
static AbsExtendedPrimitive wrap(java.lang.Object value)
          Create an AbsExtendedPrimitive of type value.getClass() containing a given value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ABS_EXTENDED_PRIMITIVE

public static final int ABS_EXTENDED_PRIMITIVE
See Also:
Constant Field Values
Constructor Detail

AbsExtendedPrimitive

public AbsExtendedPrimitive(java.lang.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(java.lang.Object value)
Create an AbsExtendedPrimitive of type value.getClass() containing a given value.


set

public void set(java.lang.Object value)
Set the value of this AbsExtendedPrimitive to the given value.

Parameters:
value - The new value
Throws:
java.lang.IllegalArgumentException - If the type of this AbsExtendedPrimitive is not correct.

get

public java.lang.Object get()
Returns:
the value of this AbsExtendedPrimitive.

getTypeName

public java.lang.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(java.lang.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 java.lang.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.

toString

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

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

getAbsType

public int getAbsType()
Specified by:
getAbsType in interface AbsObject