Class AbsAggregate

    • Constructor Detail

      • AbsAggregate

        public AbsAggregate​(String typeName)
        Construct an Abstract descriptor to hold an aggregate of the proper type (i.e. SET, SEQUENCE...).
        Parameters:
        typeName - The name of the type of the aggregate held by this abstract descriptor.
    • Method Detail

      • add

        public void add​(AbsTerm element)
        Adds a new element (that must be a term) to this aggregate.
        Parameters:
        element - The element to add.
      • size

        public int size()
        Retrieves the number of elements in this aggregate.
        Returns:
        The number of elements.
      • get

        public AbsTerm get​(int i)
        Retrieves the i-th element in this aggregate.
        Parameters:
        i - The index of the element to retrieve.
        Returns:
        The element.
      • iterator

        public Iterator iterator()
        Returns:
        An Iterator over the elements of this aggregate.
      • clear

        public void clear()
        Clear all the elements in this aggregate.
      • contains

        public boolean contains​(AbsTerm element)
        Test if a given term is contained in this aggregate.
        Returns:
        true if the given term is contained in this aggregate.
      • indexOf

        public int indexOf​(AbsTerm element)
        Returns the position of an element within this aggregate.
        Returns:
        The position of an element within this aggregate.
      • remove

        public AbsTerm remove​(int index)
        Removes the element at the given position from this aggregate.
        Returns:
        The removed element.
      • remove

        public boolean remove​(AbsTerm element)
        Removes an element from this aggregate.
        Returns:
        The removed element.
      • isEmpty

        public boolean isEmpty()
        Test if the aggregate is empty.
        Returns:
        true if this aggregate does not contain any element.
      • toArray

        public AbsTerm[] toArray()
        Retrieve all elements in this aggregate in the form of an array.
        Returns:
        An array containing all elements in this aggregate.
      • set

        public void set​(String name,
                        AbsTerm value)
        Overrides this method to check that name is of the form Codec.UNNAMEDPERFIX+index
        Overrides:
        set in class AbsConcept
        Parameters:
        name - The name of the attribute to be set.
        value - The new value of the attribute.
        Throws:
        IllegalArgumentException - if name is not of the form Codec.UNNAMEDPERFIX+index
      • dump

        protected void dump​(int indent,
                            PrintStream ps)
      • getElementTemplate

        public AbsTerm getElementTemplate()
        Get the abstract template of aggregate element
      • setElementTemplate

        public void setElementTemplate​(AbsTerm elementTemplate)
        Set the abstract template of aggregate element
      • 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.
        Overrides:
        toString in class AbsObjectImpl