Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.javatools.xml.bind
Interface ElementList<T>

All Superinterfaces:
java.lang.Iterable<T>

public interface ElementList<T>
extends java.lang.Iterable<T>

PLEASE NOTE: Do not implement this interface directly. Instances are obtained through the XML binding code. Methods may be added to this interface in the future to enhance the binding features, so any direct implementations would be broken.

Interface implemented by a bound proxy when it represents a list of elements.


Method Summary
 void add(int index, T element)
          Adds the specified object before the specified index.
 void add(T element)
          Adds the specified object to the end of the list.
 void addElementListListener(ElementListListener listener)
          Adds the specified listener to receive events when changes are made to this ElementList instance through ElementList methods.
 void clear()
          Removes all elements from the ElementList.
 T createElement()
          For a uniform ElementList, in which all the elements are of the same type, this method returns a new object of that type.
 java.lang.Class elementType()
          If the ElementList represents a single type of element, that type is returned from this method.
 java.lang.Object get(int index)
           
 boolean isEmpty()
           
 java.util.Iterator<T> iterator()
           
 T remove(int index)
          Removes the object at the specified index.
 void removeElementListListener(ElementListListener listener)
          Removes the specified ElementListListener so that it no longer receives events for changes to this ElementList.
 T set(int index, java.lang.Object element)
          Replaces the object at the specified index with the specified object.
 int size()
          Returns the number of items in the ElementList.
 

Method Detail

add

void add(int index,
         T element)
Adds the specified object before the specified index.

Throws:
java.lang.ClassCastException - if the object type doesn't match the type required by the ElementList instance.

add

void add(T element)
Adds the specified object to the end of the list.

Throws:
java.lang.ClassCastException - if the object type doesn't match the type required by the ElementList instance.

addElementListListener

void addElementListListener(ElementListListener listener)
Adds the specified listener to receive events when changes are made to this ElementList instance through ElementList methods. Listeners are called in the reverse order in which they are registered; that is, the last listener registered is the first one called.


clear

void clear()
Removes all elements from the ElementList.


createElement

T createElement()
For a uniform ElementList, in which all the elements are of the same type, this method returns a new object of that type. For a mixed ElementList, in which the elements may be of different types, this method throws IllegalStateException.

Throws:
java.lang.IllegalStateException - if the ElementList contains a mixture elements with different names.

elementType

java.lang.Class elementType()
If the ElementList represents a single type of element, that type is returned from this method. The type may be String.class, if the ElementList is holding strings. If the ElementList is configured to hold a mixture of multiple types, then this method will return null.


get

java.lang.Object get(int index)
Returns:
the object at the specified index.
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is invalid.

isEmpty

boolean isEmpty()
Returns:
true if the ElementList contains no items; false otherwise.

iterator

java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>
Returns:
an Iterator that walks through the ElementList's items in order. The returned Iterator supports the remove() method.

remove

T remove(int index)
Removes the object at the specified index.

Returns:
the removed object.
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is invalid.

removeElementListListener

void removeElementListListener(ElementListListener listener)
Removes the specified ElementListListener so that it no longer receives events for changes to this ElementList.


set

T set(int index,
      java.lang.Object element)
Replaces the object at the specified index with the specified object.

Returns:
the replaced object
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is invalid.

size

int size()
Returns the number of items in the ElementList.


Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

Copyright © 1997, 2009, Oracle. All rights reserved.