Package jade.content.abs
Class AbsObjectImpl
- java.lang.Object
-
- jade.content.abs.AbsObjectImpl
-
- All Implemented Interfaces:
AbsObject,Serializable,Serializable
- Direct Known Subclasses:
AbsIRE,AbsPrimitiveSlotsHolder,AbsReference,AbsVariable
public class AbsObjectImpl extends Object implements AbsObject
Base class for all non-primitive abstract descriptor classes. This class is not intended to be used by programmers.- Author:
- Federico Bergenti - Universita` di Parma, Giovanni Caire - TILAB
- See Also:
- Serialized Form
-
-
Field Summary
-
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 Modifier Constructor Description protectedAbsObjectImpl(String typeName)Construct an Abstract descriptor to hold an object of the proper type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Returns true if the attribute is equal to this abstract descriptor, based on the contents of both descriptors.protected AbsObjectgetAbsObject(int index)This method enables all order-based getter methods in AbsPredicateAbsObjectgetAbsObject(String name)Gets the value of an attribute of the object held by this abstract descriptor.intgetAbsType()intgetCount()Gets the number of attributes.String[]getNames()StringgetTypeName()protected AbsObject[]getValues()This method enables the omonimous method in AbsPredicateinthashCode()Returns an integer hashcode calculated from the contents of this abstract descriptorbooleanisGrounded()Tests if the object is grounded, i.e., if no one of its attributes is associated with a variableprotected voidset(String name, AbsObject value)Sets an attribute of the object held by this abstract descriptor.StringtoString()This method is here just for debugging.
-
-
-
Constructor Detail
-
AbsObjectImpl
protected AbsObjectImpl(String typeName)
Construct an Abstract descriptor to hold an object of the proper type.- Parameters:
typeName- The name of the type of the object held by this abstract descriptor.
-
-
Method Detail
-
getTypeName
public String getTypeName()
- Specified by:
getTypeNamein interfaceAbsObject- Returns:
- The name of the type of the object held by this abstract descriptor.
- See Also:
AbsObject.getTypeName()
-
set
protected void set(String name, AbsObject value)
Sets an attribute of the object held by this abstract descriptor.- Parameters:
name- The name of the attribute to be set.value- The new value of the attribute. Ifvalueis null the current mapping withname(if any) is removed.
-
getAbsObject
public AbsObject getAbsObject(String name)
Gets the value of an attribute of the object held by this abstract descriptor.- Specified by:
getAbsObjectin interfaceAbsObject- Parameters:
name- The name of the attribute.- Returns:
- value The value of the attribute.
- See Also:
AbsObject.getAbsObject(String)
-
getAbsObject
protected AbsObject getAbsObject(int index)
This method enables all order-based getter methods in AbsPredicate
-
getValues
protected AbsObject[] getValues()
This method enables the omonimous method in AbsPredicate
-
getNames
public String[] getNames()
- Specified by:
getNamesin interfaceAbsObject- Returns:
- the name of all attributes.
- See Also:
AbsObject.getNames()
-
isGrounded
public boolean isGrounded()
Tests if the object is grounded, i.e., if no one of its attributes is associated with a variable- Specified by:
isGroundedin interfaceAbsObject- Returns:
trueif the object is grounded.- See Also:
AbsObject.isGrounded()
-
getCount
public int getCount()
Gets the number of attributes.- Specified by:
getCountin interfaceAbsObject- Returns:
- the number of attributes.
- See Also:
AbsObject.getCount()
-
toString
public String toString()
This method is here just for debugging. Notice that it is highly innefficient. The method StringCodec.encode() should be used instead.
-
equals
public boolean equals(Object obj)
Returns true if the attribute is equal to this abstract descriptor, based on the contents of both descriptors.
-
hashCode
public int hashCode()
Returns an integer hashcode calculated from the contents of this abstract descriptor
-
getAbsType
public int getAbsType()
- Specified by:
getAbsTypein interfaceAbsObject
-
-