public class AbsAggregate extends AbsConcept
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 and Description |
|---|
AbsAggregate(java.lang.String typeName)
Construct an Abstract descriptor to hold an aggregate of
the proper type (i.e.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(AbsTerm element)
Adds a new element (that must be a term) to this aggregate.
|
void |
clear()
Clear all the elements in this aggregate.
|
boolean |
contains(AbsTerm element)
Test if a given term is contained in this aggregate.
|
protected void |
dump(int indent,
java.io.PrintStream ps) |
AbsTerm |
get(int i)
Retrieves the
i-th element in this aggregate. |
AbsObject |
getAbsObject(java.lang.String name)
Overrides this method to check that name is of the form
Codec.UNNAMEDPERFIX+index
|
int |
getAbsType() |
int |
getCount()
Overrides method in superclass
|
AbsTerm |
getElementTemplate()
Get the abstract template of aggregate element
|
java.lang.String[] |
getNames()
Overrides method in superclass
|
int |
indexOf(AbsTerm element)
Returns the position of an element within this aggregate.
|
boolean |
isEmpty()
Test if the aggregate is empty.
|
boolean |
isGrounded()
Tests if this AbsAggregate is grounded, i.e., if no one of its elements
is associated with a variable
|
Iterator |
iterator() |
boolean |
remove(AbsTerm element)
Removes an element from this aggregate.
|
AbsTerm |
remove(int index)
Removes the element at the given position from this aggregate.
|
void |
set(java.lang.String name,
AbsTerm value)
Overrides this method to check that name is of the form
Codec.UNNAMEDPERFIX+index
|
void |
setElementTemplate(AbsTerm elementTemplate)
Set the abstract template of aggregate element
|
int |
size()
Retrieves the number of elements in this aggregate.
|
AbsTerm[] |
toArray()
Retrieve all elements in this aggregate in the form of an array.
|
java.lang.String |
toString()
This method is here just for debugging.
|
getAbsTerm, getJavaClassgetBoolean, getByteSequence, getDate, getDouble, getFloat, getInteger, getLong, getString, set, set, set, set, set, set, set, set, setequals, getTypeName, hashCodeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetTypeNamepublic AbsAggregate(java.lang.String typeName)
typeName - The name of the type of the aggregate held by
this abstract descriptor.public void add(AbsTerm element)
element - The element to add.public int size()
public AbsTerm get(int i)
i-th element in this aggregate.i - The index of the element to retrieve.public Iterator iterator()
Iterator over the elements of this
aggregate.public void clear()
public boolean contains(AbsTerm element)
true if the given term is contained
in this aggregate.public int indexOf(AbsTerm element)
public AbsTerm remove(int index)
public boolean remove(AbsTerm element)
public boolean isEmpty()
true if this aggregate does not contain
any element.public AbsTerm[] toArray()
public void set(java.lang.String name,
AbsTerm value)
set in class AbsConceptname - The name of the attribute to be set.value - The new value of the attribute.java.lang.IllegalArgumentException - if name is not of the form
Codec.UNNAMEDPERFIX+indexprotected void dump(int indent,
java.io.PrintStream ps)
public AbsObject getAbsObject(java.lang.String name)
getAbsObject in interface AbsObjectgetAbsObject in class AbsObjectImplname - The name of the attribute.AbsObject.getAbsObject(String)public java.lang.String[] getNames()
getNames in interface AbsObjectgetNames in class AbsObjectImplAbsObject.getNames()public boolean isGrounded()
isGrounded in interface AbsObjectisGrounded in class AbsObjectImpltrue if the object is grounded.AbsObject.isGrounded()public int getCount()
getCount in interface AbsObjectgetCount in class AbsObjectImplAbsObject.getCount()public int getAbsType()
getAbsType in interface AbsObjectgetAbsType in class AbsConceptpublic AbsTerm getElementTemplate()
public void setElementTemplate(AbsTerm elementTemplate)
public java.lang.String toString()
toString in class AbsObjectImplStringCodec.encode(AbsContentElement content)