Package jade.content.abs
Class AbsExtendedPrimitive
- java.lang.Object
-
- jade.content.abs.AbsExtendedPrimitive
-
- All Implemented Interfaces:
AbsObject,AbsTerm,Term,Serializable,Serializable
public class AbsExtendedPrimitive extends Object implements AbsTerm
An extended abstract descriptor that can hold a generic primitive types (eg. java.math.BigDecimal) not supported byAbsPrimitive.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intABS_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_REFERENCE, ABS_VARIABLE, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description AbsExtendedPrimitive(String typeName)Construct an Abstract descriptor to hold a extended-primitive of the proper type (e.g.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Objectget()AbsObjectgetAbsObject(String name)Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return nullintgetAbsType()intgetCount()Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return 0String[]getNames()Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return nullStringgetTypeName()inthashCode()booleanisGrounded()Tests if this AbsExtendedPrimitive is grounded.voidset(Object value)Set the value of this AbsExtendedPrimitive to the given value.StringtoString()static AbsExtendedPrimitivewrap(Object value)Create an AbsExtendedPrimitive of typevalue.getClass()containing a given value.
-
-
-
Field Detail
-
ABS_EXTENDED_PRIMITIVE
public static final int ABS_EXTENDED_PRIMITIVE
- See Also:
- Constant Field Values
-
-
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 typevalue.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:
getTypeNamein interfaceAbsObject- 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:
getAbsObjectin interfaceAbsObject- 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
-
isGrounded
public boolean isGrounded()
Tests if this AbsExtendedPrimitive is grounded. It always returns true- Specified by:
isGroundedin interfaceAbsObject- Returns:
trueif the object is grounded.
-
getCount
public int getCount()
Makes no sense in the case of an AbsExtendedPrimitive that has no attribute --> Just return 0
-
getAbsType
public int getAbsType()
- Specified by:
getAbsTypein interfaceAbsObject
-
-