JADE_SL.abs
Class AbsContentElementList

java.lang.Object
  extended byJADE_SL.abs.AbsContentElementList
All Implemented Interfaces:
AbsContentElement, AbsObject

public class AbsContentElementList
extends java.lang.Object
implements AbsContentElement

Author:
Federico Bergenti - Universita` di Parma

Field Summary
private  java.util.List elements
           
private  java.lang.String typeName
           
 
Constructor Summary
AbsContentElementList()
          Construct an Abstract descriptor to hold a content element list
 
Method Summary
 void add(AbsContentElement element)
          Add a new element (that must be a content element) to this content element list.
 void clear()
          Clear all the elements in this content element list.
 boolean contains(AbsContentElement element)
          Test if a given content element is contained in this content element list.
 void dump()
           
protected  void dump(int indent, java.io.PrintStream ps)
           
 AbsContentElement get(int i)
          Retrieves the i-th element in this content element list.
 AbsObject getAbsObject(java.lang.String name)
          Makes no sense in the case of an AbsContentElementList that has no attribute --> Just return null
 int getCount()
          Makes no sense in the case of an AbsContentElementList that has no attribute --> Just return 0
 java.lang.String[] getNames()
          Makes no sense in the case of an AbsContentElementList that has no attribute --> Just return null
 java.lang.String getTypeName()
           
 int indexOf(AbsContentElement element)
          Returns the position of an element within this content element list.
 boolean isEmpty()
          Test if the content element list is empty.
 boolean isGrounded()
          Tests if this AbsContentElementList is grounded, i.e., if no one of its elements is associated with a variable
 java.util.Iterator iterator()
           
 AbsContentElement remove(int index)
          Removes the element at the given position from this content element list.
 int size()
          Retrieves the number of elements in this content element list.
 AbsContentElement[] toArray()
          Retrieve all elements in this content element list in the form of an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elements

private java.util.List elements

typeName

private java.lang.String typeName
Constructor Detail

AbsContentElementList

public AbsContentElementList()
Construct an Abstract descriptor to hold a content element list

Method Detail

add

public void add(AbsContentElement element)
Add a new element (that must be a content element) to this content element list.

Parameters:
element - The element to add.

size

public int size()
Retrieves the number of elements in this content element list.

Returns:
The number of elements.

get

public AbsContentElement get(int i)
Retrieves the i-th element in this content element list.

Parameters:
i - The index of the element to retrieve.
Returns:
The element.

iterator

public java.util.Iterator iterator()
Returns:
An Iterator over the elements of this content element list.

clear

public void clear()
Clear all the elements in this content element list.


contains

public boolean contains(AbsContentElement element)
Test if a given content element is contained in this content element list.

Returns:
true if the given content element is contained in this content element list.

indexOf

public int indexOf(AbsContentElement element)
Returns the position of an element within this content element list.

Returns:
The position of an element within this content element list or -1 if the given element is not contained in this content element list.

remove

public AbsContentElement remove(int index)
Removes the element at the given position from this content element list.

Returns:
The removed element.

isEmpty

public boolean isEmpty()
Test if the content element list is empty.

Returns:
true if this content element list does not contain any element.

toArray

public AbsContentElement[] toArray()
Retrieve all elements in this content element list in the form of an array.

Returns:
An array containing all elements in this content element list.

dump

protected void dump(int indent,
                    java.io.PrintStream ps)

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.
See Also:
AbsObject.getTypeName()

getAbsObject

public AbsObject getAbsObject(java.lang.String name)
Makes no sense in the case of an AbsContentElementList 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 AbsContentElementList 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 AbsContentElementList is grounded, i.e., if no one of its elements is associated with a variable

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 AbsContentElementList that has no attribute --> Just return 0

Specified by:
getCount in interface AbsObject
Returns:
the number of attributes.

dump

public void dump()
Specified by:
dump in interface AbsObject


Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.