|
Oracle Application Server TopLink API Reference 10g Release 2 (10.1.2) B15903-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PUBLIC
CursoredCollection is an interface that conforms to Collection while providing Cursor behaviour. This interface is returned from an EJB finder method that uses TopLink CursoredStream support. This is TopLink's way of providing cursored support to EJB2.0 finders. Although all methods are provided, only the following are supported: isEmpty() size() iterator() Example: Execute a finder that reads 150 projects. Read the first 50 as singles, then, read the next 50 in bulk. This simulates a screen paging down.
import oracle.toplink.ejb.cmp.wls.*;
import java.util.*;
CursoredIterator cursoredIterator;
ProjectHome projectHome = getProjectHome();
//begin a transaction. Leave this open until done
getTransaction().begin();
System.out.println("Finding multiple Projects...");
Vector projects = new Vector();
cursoredIterator = (CursoredIterator)projectHome.findByNameCursored("proj%").iterator();
for (int index = 0; index < 50; i++) {
Project project = (Project)cursoredIterator.next();
projects.addElement(project);
CursoredStream
, CursoredIterator
Method Summary | |
boolean |
add(java.lang.Object objectToAdd) Add the provided object to the Collection. |
boolean |
addAll(java.util.Collection objectsToAdd) Add the provided objects to the Collection. |
void |
clear() Removes all of the elements from the Collection. |
boolean |
contains(java.lang.Object object) Returns true if the specified element is contained in the Collection. |
boolean |
containsAll(java.util.Collection collection) Returns true if the specified elements are all contained in the Collection. |
boolean |
isEmpty() Returns true if this Collection contains no elements. |
java.util.Iterator |
iterator() Returns an Iterator which can retrieve the elements contained in this Collection. |
boolean |
remove(java.lang.Object object) If the provided object exists in this Collection, the first match is removed. |
boolean |
removeAll(java.util.Collection collection) Removes any elements from the provided collection that exist in this Collection. |
boolean |
retainAll(java.util.Collection collection) Given the provided collection, remove all elements in this Collection (the receiver) that are NOT contained in the provided collection. |
int |
size() Return the size of this Collection. |
java.lang.Object[] |
toArray() Returns an Array containing all elements in this Collection. |
java.lang.Object[] |
toArray(java.lang.Object[] array) Returns an Array containing all elements in this Collection whose type matches any type in the provided array. |
Methods inherited from interface java.util.Collection |
equals, hashCode |
Method Detail |
public boolean add(java.lang.Object objectToAdd)
Add the provided object to the Collection. (not supported, just here for interface)
add
in interface java.util.Collection
objectToAdd
- Object to add to the collectionpublic boolean addAll(java.util.Collection objectsToAdd)
Add the provided objects to the Collection. (not supported, just here for interface)
addAll
in interface java.util.Collection
objectsToAdd
- Collection of objects to addpublic void clear()
Removes all of the elements from the Collection. (not supported, just here for interface)
clear
in interface java.util.Collection
public boolean contains(java.lang.Object object)
Returns true if the specified element is contained in the Collection. (not supported, just here for interface)
contains
in interface java.util.Collection
object
- Object to check for inclusion ofpublic boolean containsAll(java.util.Collection collection)
Returns true if the specified elements are all contained in the Collection. (not supported, just here for interface)
containsAll
in interface java.util.Collection
collection
- Collection of objects to check for inclusionpublic boolean isEmpty()
Returns true if this Collection contains no elements.
isEmpty
in interface java.util.Collection
public java.util.Iterator iterator()
Returns an Iterator which can retrieve the elements contained in this Collection.
iterator
in interface java.util.Collection
public boolean remove(java.lang.Object object)
If the provided object exists in this Collection, the first match is removed.
remove
in interface java.util.Collection
object
- Object to removeIterator
, CursoredIterator
public boolean removeAll(java.util.Collection collection)
Removes any elements from the provided collection that exist in this Collection. (not supported, just here for interface)
removeAll
in interface java.util.Collection
collection
- Collection of objects to removepublic boolean retainAll(java.util.Collection collection)
Given the provided collection, remove all elements in this Collection (the receiver) that are NOT contained in the provided collection. (not supported, just here for interface)
retainAll
in interface java.util.Collection
collection
- Collection of objects to keeppublic int size()
Return the size of this Collection. (not supported, just here for interface)
size
in interface java.util.Collection
public java.lang.Object[] toArray()
Returns an Array containing all elements in this Collection.
toArray
in interface java.util.Collection
public java.lang.Object[] toArray(java.lang.Object[] array)
Returns an Array containing all elements in this Collection whose type matches any type in the provided array. (not supported, just here for interface)
toArray
in interface java.util.Collection
array
- Array with types to match receiver's types.
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |