Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.data
Class ListStructure

java.lang.Object
  extended by oracle.javatools.data.Structure
      extended by oracle.javatools.data.ListStructure

All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.List, Dirtyable

public class ListStructure
extends Structure
implements java.util.List

This class implements a list data structure that complements HashStructure. Instances of ListStructure can be contained in HashStructure and vice versa. ListStructure may also contain other instances of ListStructure.

Supported Types

The only types of objects that may be added to ListStructure are the same types that are supported by HashStructure:

The public methods of ListStructure are a subset of the methods declared by the List interface. This class may be enhanced in the future to implement the List interface completely.


Method Summary
 void add(int index, java.lang.Object obj)
          Adds the specified object to this ListStructure at the specified index.
 boolean add(java.lang.Object obj)
          Adds the specified object to the end of this ListStructure.
 boolean addAll(java.util.Collection coll)
          Adds all of the objects in the specified Collection to the end of this ListStructure.
 boolean addAll(int index, java.util.Collection coll)
          Adds all of the objects in the specified Collection to this ListStructure at the specified index.
 boolean addPlaceholder(java.lang.Object obj)
          Adds the specified object to the end of this ListStructure as a placeholder value.
 void clear()
          Removes all objects from this ListStructure.
 boolean contains(java.lang.Object obj)
          Returns true if this ListStructure contains the specified object; false otherwise.
 boolean containsAll(java.util.Collection coll)
          Returns true if this ListStructure contains all of the objects in the specified Collection; false otherwise.
 ListStructure copyTo(ListStructure dest)
           
 boolean equals(java.lang.Object obj)
           
protected  boolean equalsImpl(ListStructure other)
           
 java.lang.Object get(int index)
          Returns the object located at the specified index.
 int hashCode()
           
 int indexOf(java.lang.Object obj)
          Returns the index of the specified object in this ListStructure.
 void internalPreprsist()
          Do not use this method.
 boolean isEmpty()
          Returns true if the ListStructure currently contains zero items; false otherwise.
 java.util.Iterator iterator()
          Returns an Iterator over the current ListStructure.
 java.lang.Object iteratorLock()
          Returns the object on which callers must lock when using the iterator() method on this class.
 int lastIndexOf(java.lang.Object obj)
          Returns the index of the last occurrence of the specified object in this ListStructure.
 java.util.ListIterator listIterator()
          Currently throws UnsupportedOperationException.
 java.util.ListIterator listIterator(int i)
          Currently throws UnsupportedOperationException.
 boolean mirror(java.util.List list)
          Sets this ListStructure to mirror the contents of the specified List.
static ListStructure newInstance()
           
 java.lang.Object remove(int index)
          Removes the object at the specified index from this ListStructure, returning the object removed.
 boolean remove(java.lang.Object obj)
          Removes the first occurrence of the specified object from this ListStructure.
 boolean removeAll(java.util.Collection coll)
          Removes all of the objects in the specified Collection from this ListStructure.
 boolean retainAll(java.util.Collection coll)
          Removes all items from this ListStructure except for the ones in the specified Collection.
 java.lang.Object set(int index, java.lang.Object newValue)
          Replaces the object at the specified index with the specified new value.
 int size()
          Returns the number of items currently contained in this ListStructure.
 java.util.List subList(int i, int j)
          Currently throws UnsupportedOperationException.
 java.lang.Object[] toArray()
          Returns the contents of this ListStructure as an Object array.
 java.lang.Object[] toArray(java.lang.Object[] array)
          Copies the contents of this ListStructure into the specified array.

 

Methods inherited from class oracle.javatools.data.Structure
addStructureChangeListener, applyBatchChanges, getFullName, getStructName, intern, intern, isDirty, markDirty, removeStructureChangeListener

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

newInstance

public static final ListStructure newInstance()

add

public void add(int index,
                java.lang.Object obj)
Adds the specified object to this ListStructure at the specified index.
Specified by:
add in interface java.util.List
Throws:
java.lang.IllegalArgumentException - if the object is not one of the supported types
java.lang.IndexOutOfBoundsException - if the specified index is out of range for the current ListStructure.

add

public boolean add(java.lang.Object obj)
Adds the specified object to the end of this ListStructure.
Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Throws:
java.lang.IllegalArgumentException - if the object is not one of the supported types

addPlaceholder

public boolean addPlaceholder(java.lang.Object obj)
Adds the specified object to the end of this ListStructure as a placeholder value. See HashStructure#placeholder for more details on placeholder value. The ListStructure does not become dirty from calling addPlaceholder.
Throws:
java.lang.IllegalArgumentException - if the object is not one of the supported types

addAll

public boolean addAll(int index,
                      java.util.Collection coll)
Adds all of the objects in the specified Collection to this ListStructure at the specified index.
Specified by:
addAll in interface java.util.List
Throws:
java.lang.IllegalArgumentException - if any object in the Collection is not one of the supported types
java.lang.IndexOutOfBoundsException - if the specified index is out of range for the current ListStructure.

addAll

public boolean addAll(java.util.Collection coll)
Adds all of the objects in the specified Collection to the end of this ListStructure.
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List
Throws:
java.lang.IllegalArgumentException - if any object in the Collection is not one of the supported types

clear

public void clear()
Removes all objects from this ListStructure.
Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List
Overrides:
clear in class Structure

contains

public boolean contains(java.lang.Object obj)
Returns true if this ListStructure contains the specified object; false otherwise.
Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.List

containsAll

public boolean containsAll(java.util.Collection coll)
Returns true if this ListStructure contains all of the objects in the specified Collection; false otherwise.
Specified by:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.List

get

public java.lang.Object get(int index)
Returns the object located at the specified index.
Specified by:
get in interface java.util.List
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is out of range for the current ListStructure.

indexOf

public int indexOf(java.lang.Object obj)
Returns the index of the specified object in this ListStructure.
Specified by:
indexOf in interface java.util.List

isEmpty

public boolean isEmpty()
Returns true if the ListStructure currently contains zero items; false otherwise.
Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List

iteratorLock

public java.lang.Object iteratorLock()
Returns the object on which callers must lock when using the iterator() method on this class.
Returns:
an object on which callers must lock when using the iterator() method on this class.

iterator

public java.util.Iterator iterator()
Returns an Iterator over the current ListStructure. The returned Iterator supports the remove method. Thread safety: Callers must lock the list while iterating. Do this as follows:
    synchronized ( ls.iteratorLock() )
    {
      for ( Iterator i = ls.iterator(); i.hasNext(); ) 
      {
        // ....
      }
    }
  
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.List

lastIndexOf

public int lastIndexOf(java.lang.Object obj)
Returns the index of the last occurrence of the specified object in this ListStructure.
Specified by:
lastIndexOf in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Currently throws UnsupportedOperationException.
Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int i)
Currently throws UnsupportedOperationException.
Specified by:
listIterator in interface java.util.List

remove

public java.lang.Object remove(int index)
Removes the object at the specified index from this ListStructure, returning the object removed.
Specified by:
remove in interface java.util.List
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is out of range for the current ListStructure.

remove

public boolean remove(java.lang.Object obj)
Removes the first occurrence of the specified object from this ListStructure. Returns true if the removal occurred, false otherwise.
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection coll)
Removes all of the objects in the specified Collection from this ListStructure. Returns true if any item was removed (not necessarily all items); false otherwise.
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List

retainAll

public boolean retainAll(java.util.Collection coll)
Removes all items from this ListStructure except for the ones in the specified Collection. Returns true if any items (possibly all items) were removed; false otherwise.
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List

set

public java.lang.Object set(int index,
                            java.lang.Object newValue)
Replaces the object at the specified index with the specified new value.
Specified by:
set in interface java.util.List
Throws:
java.lang.IllegalArgumentException - if the object is not one of the supported types
java.lang.IndexOutOfBoundsException - if the specified index is out of range for the current ListStructure.

subList

public java.util.List subList(int i,
                              int j)
Currently throws UnsupportedOperationException.
Specified by:
subList in interface java.util.List

size

public int size()
Returns the number of items currently contained in this ListStructure.
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List

toArray

public java.lang.Object[] toArray()
Returns the contents of this ListStructure as an Object array.
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List

toArray

public java.lang.Object[] toArray(java.lang.Object[] array)
Copies the contents of this ListStructure into the specified array.
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List

mirror

public boolean mirror(java.util.List list)
Sets this ListStructure to mirror the contents of the specified List. If the list is null, this ListStructure is cleared.

internalPreprsist

public void internalPreprsist()
Do not use this method. Its behavior is not documented and may change or be removed without notice.

copyTo

public ListStructure copyTo(ListStructure dest)

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class java.lang.Object

equalsImpl

protected boolean equalsImpl(ListStructure other)

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


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