Skip navigation links

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

B32476-02


oracle.toplink.indirection
Class IndirectList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by oracle.toplink.indirection.IndirectList

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess, ChangeTracker, CollectionChangeTracker, IndirectCollection, IndirectContainer
Direct Known Subclasses:
EJBIndirectList

public class IndirectList
extends java.util.Vector
implements CollectionChangeTracker, IndirectCollection

IndirectList allows a domain class to take advantage of TopLink indirection without having to declare its instance variable as a ValueHolderInterface.

To use an IndirectList:

TopLink will place an IndirectList in the instance variable when the containing domain object is read from the datatabase. With the first message sent to the IndirectList, the contents are fetched from the database and normal Collection/List/Vector behavior is resumed.

Since:
TOPLink/Java 2.5
See Also:
CollectionMapping, IndirectMap, Serialized Form

Constructor Summary
IndirectList()
          Construct an empty IndirectList so that its internal data array has size 10 and its standard capacity increment is zero.
IndirectList(java.util.Collection c)
          Construct an IndirectList containing the elements of the specified collection, in the order they are returned by the collection's iterator.
IndirectList(int initialCapacity)
          Construct an empty IndirectList with the specified initial capacity and with its capacity increment equal to zero.
IndirectList(int initialCapacity, int capacityIncrement)
          Construct an empty IndirectList with the specified initial capacity and capacity increment.

 

Method Summary
 void add(int index, java.lang.Object element)
           
 boolean add(java.lang.Object element)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection c)
           
 void addElement(java.lang.Object obj)
           
 int capacity()
           
 void clear()
           
 java.lang.Object clone()
          
 boolean contains(java.lang.Object element)
          
 boolean containsAll(java.util.Collection c)
           
 void copyInto(java.lang.Object[] anArray)
           
 java.lang.Object elementAt(int index)
           
 java.util.Enumeration elements()
           
 void ensureCapacity(int minCapacity)
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object firstElement()
           
 java.lang.Object get(int index)
           
 int indexOf(java.lang.Object elem)
           
 int indexOf(java.lang.Object elem, int index)
           
 void insertElementAt(java.lang.Object obj, int index)
           
 boolean isEmpty()
           
 boolean isInstantiated()
          Return whether the contents have been read from the database.
 java.util.Iterator iterator()
           
 java.lang.Object lastElement()
           
 int lastIndexOf(java.lang.Object elem)
           
 int lastIndexOf(java.lang.Object elem, int index)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object element)
           
 boolean removeAll(java.util.Collection c)
           
 void removeAllElements()
           
 boolean removeElement(java.lang.Object obj)
           
 void removeElementAt(int index)
           
 boolean retainAll(java.util.Collection c)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 void setElementAt(java.lang.Object obj, int index)
           
 void setSize(int newSize)
           
 int size()
           
 java.util.List subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 java.lang.String toString()
          Use the java.util.Vector#toString(); but wrap it with braces to indicate there is a bit of indirection.
 void trimToSize()
           

 

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

 

Constructor Detail

IndirectList

public IndirectList()
Construct an empty IndirectList so that its internal data array has size 10 and its standard capacity increment is zero.

IndirectList

public IndirectList(int initialCapacity)
Construct an empty IndirectList with the specified initial capacity and with its capacity increment equal to zero.
Parameters:
initialCapacity - the initial capacity of the vector
Throws:
java.lang.IllegalArgumentException - if the specified initial capacity is negative

IndirectList

public IndirectList(int initialCapacity,
                    int capacityIncrement)
Construct an empty IndirectList with the specified initial capacity and capacity increment.
Parameters:
initialCapacity - the initial capacity of the vector
capacityIncrement - the amount by which the capacity is increased when the vector overflows
Throws:
java.lang.IllegalArgumentException - if the specified initial capacity is negative

IndirectList

public IndirectList(java.util.Collection c)
Construct an IndirectList containing the elements of the specified collection, in the order they are returned by the collection's iterator.
Parameters:
c - a collection containing the elements to construct this IndirectList with.

Method Detail

add

public void add(int index,
                java.lang.Object element)
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.Vector
See Also:
Vector.add(int, java.lang.Object)

add

public boolean add(java.lang.Object element)
Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.Vector
See Also:
Vector.add(java.lang.Object)

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.Vector
See Also:
Vector.addAll(int, java.util.Collection)

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.Vector
See Also:
Vector.addAll(java.util.Collection)

addElement

public void addElement(java.lang.Object obj)
Overrides:
addElement in class java.util.Vector
See Also:
Vector.addElement(java.lang.Object)

capacity

public int capacity()
Overrides:
capacity in class java.util.Vector
See Also:
Vector.capacity()

clear

public void clear()
Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List
Overrides:
clear in class java.util.Vector
See Also:
Vector.clear()

clone

public java.lang.Object clone()
Overrides:
clone in class java.util.Vector
See Also:
This will result in a database query if necessary.

contains

public boolean contains(java.lang.Object element)
Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.List
Overrides:
contains in class java.util.Vector
See Also:
Vector.contains(java.lang.Object)

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.List
Overrides:
containsAll in class java.util.Vector
See Also:
Vector.containsAll(java.util.Collection)

copyInto

public void copyInto(java.lang.Object[] anArray)
Overrides:
copyInto in class java.util.Vector
See Also:
Vector.copyInto(java.lang.Object[])

elementAt

public java.lang.Object elementAt(int index)
Overrides:
elementAt in class java.util.Vector
See Also:
Vector.elementAt(int)

elements

public java.util.Enumeration elements()
Overrides:
elements in class java.util.Vector
See Also:
Vector.elements()

ensureCapacity

public void ensureCapacity(int minCapacity)
Overrides:
ensureCapacity in class java.util.Vector
See Also:
Vector.ensureCapacity(int)

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class java.util.Vector
See Also:
Vector.equals(java.lang.Object)

firstElement

public java.lang.Object firstElement()
Overrides:
firstElement in class java.util.Vector
See Also:
Vector.firstElement()

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List
Overrides:
get in class java.util.Vector
See Also:
Vector.get(int)

indexOf

public int indexOf(java.lang.Object elem)
Specified by:
indexOf in interface java.util.List
Overrides:
indexOf in class java.util.Vector
See Also:
Vector.indexOf(java.lang.Object)

indexOf

public int indexOf(java.lang.Object elem,
                   int index)
Overrides:
indexOf in class java.util.Vector
See Also:
Vector.indexOf(java.lang.Object, int)

insertElementAt

public void insertElementAt(java.lang.Object obj,
                            int index)
Overrides:
insertElementAt in class java.util.Vector
See Also:
Vector.insertElementAt(java.lang.Object, int)

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List
Overrides:
isEmpty in class java.util.Vector
See Also:
Vector.isEmpty()

isInstantiated

public boolean isInstantiated()
Return whether the contents have been read from the database.
Specified by:
isInstantiated in interface IndirectContainer

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.List
Overrides:
iterator in class java.util.AbstractList
See Also:
AbstractList.iterator()

lastElement

public java.lang.Object lastElement()
Overrides:
lastElement in class java.util.Vector
See Also:
Vector.lastElement()

lastIndexOf

public int lastIndexOf(java.lang.Object elem)
Specified by:
lastIndexOf in interface java.util.List
Overrides:
lastIndexOf in class java.util.Vector
See Also:
Vector.lastIndexOf(java.lang.Object)

lastIndexOf

public int lastIndexOf(java.lang.Object elem,
                       int index)
Overrides:
lastIndexOf in class java.util.Vector
See Also:
Vector.lastIndexOf(java.lang.Object, int)

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List
Overrides:
listIterator in class java.util.AbstractList
See Also:
AbstractList.listIterator()

listIterator

public java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List
Overrides:
listIterator in class java.util.AbstractList
See Also:
AbstractList.listIterator(int)

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.Vector
See Also:
Vector.remove(int)

remove

public boolean remove(java.lang.Object element)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.Vector
See Also:
Vector.remove(java.lang.Object)

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List
Overrides:
removeAll in class java.util.Vector
See Also:
Vector.removeAll(java.util.Collection)

removeAllElements

public void removeAllElements()
Overrides:
removeAllElements in class java.util.Vector
See Also:
Vector.removeAllElements()

removeElement

public boolean removeElement(java.lang.Object obj)
Overrides:
removeElement in class java.util.Vector
See Also:
Vector.removeElement(java.lang.Object)

removeElementAt

public void removeElementAt(int index)
Overrides:
removeElementAt in class java.util.Vector
See Also:
Vector.removeElementAt(int)

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List
Overrides:
retainAll in class java.util.Vector
See Also:
Vector.retainAll(java.util.Collection)

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Specified by:
set in interface java.util.List
Overrides:
set in class java.util.Vector
See Also:
Vector.set(int, java.lang.Object)

setElementAt

public void setElementAt(java.lang.Object obj,
                         int index)
Overrides:
setElementAt in class java.util.Vector
See Also:
Vector.setElementAt(java.lang.Object, int)

setSize

public void setSize(int newSize)
Overrides:
setSize in class java.util.Vector
See Also:
Vector.setSize(int)

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
Overrides:
size in class java.util.Vector
See Also:
Vector.size()

subList

public java.util.List subList(int fromIndex,
                int toIndex)
Specified by:
subList in interface java.util.List
Overrides:
subList in class java.util.Vector
See Also:
Vector.subList(int, int)

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class java.util.Vector
See Also:
Vector.toArray()

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class java.util.Vector
See Also:
Vector.toArray(java.lang.Object[])

toString

public java.lang.String toString()
Use the java.util.Vector#toString(); but wrap it with braces to indicate there is a bit of indirection. Don't allow this method to trigger a database read.
Overrides:
toString in class java.util.Vector
See Also:
Vector.toString()

trimToSize

public void trimToSize()
Overrides:
trimToSize in class java.util.Vector
See Also:
Vector.trimToSize()

Skip navigation links

Copyright © 1998, 2009, Oracle. All Rights Reserved.