|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList
org.datanucleus.store.query.AbstractQueryResult
public abstract class AbstractQueryResult
Abstract representation of a QueryResult. Provides default implementations of the majority of list methods that we aren't likely to be providing in a concrete query result. This class is used where your query implementation needs to return a wrapper to a List so that you can intercept calls and convert a row of the results into object(s), to avoid full instantiation at creation.
| Field Summary | |
|---|---|
protected boolean |
closed
Whether the results are close. |
protected java.util.List |
connectionListeners
List of listeners to notify when the query results are closed. |
protected static Localiser |
LOCALISER
Localiser for messages. |
protected Query |
query
The Query object. |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
AbstractQueryResult(Query query)
Constructor of the result from a Query. |
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.Object element)
Method to add a result. |
boolean |
add(java.lang.Object o)
Method to add results. |
boolean |
addAll(int index,
java.util.Collection c)
Method to add results. |
void |
addConnectionListener(ManagedConnectionResourceListener listener)
Method to register a listener to be notified when the query result is closing. |
protected void |
assertIsOpen()
Internal method to throw an Exception if the ResultSet is open. |
void |
clear()
Method to clear the results. |
void |
close()
Method to close the results, meaning that they are inaccessible after this point. |
protected abstract void |
closeResults()
Inform the query result that we are closing the results now. |
protected abstract void |
closingConnection()
Inform the query result that the connection is being closed so perform any operations now, or rest in peace. |
boolean |
contains(java.lang.Object o)
Method to check if the specified object is contained in this result. |
boolean |
containsAll(java.util.Collection c)
Method to check if all of the specified objects are contained here. |
void |
disconnect()
Method to disconnect the results from the ObjectManager, meaning that thereafter it just behaves like a List. |
abstract boolean |
equals(java.lang.Object o)
Equality operator for QueryResults. |
abstract java.lang.Object |
get(int index)
Method to retrieve a particular element from the list. |
int |
hashCode()
Accessor for the hashcode of this object |
int |
indexOf(java.lang.Object o)
Method to check the index of a result. |
boolean |
isEmpty()
Returns true if this collection contains no elements. |
protected boolean |
isOpen()
Accessor whether the results are open. |
abstract java.util.Iterator |
iterator()
Accessor for an iterator for the results. |
int |
lastIndexOf(java.lang.Object o)
Method to check the last index of a result. |
abstract java.util.ListIterator |
listIterator()
Accessor for a list iterator for the results. |
java.lang.Object |
remove(int index)
Method to remove a result. |
java.lang.Object |
set(int index,
java.lang.Object element)
Method to set the position of a result. |
abstract int |
size()
Method to return the size of the result. |
java.util.List |
subList(int fromIndex,
int toIndex)
Method return a sub list of results. |
java.lang.Object[] |
toArray()
Method to return the results as an array. |
java.lang.Object[] |
toArray(java.lang.Object[] a)
Method to return the results as an array. |
| Methods inherited from class java.util.AbstractList |
|---|
listIterator, removeRange |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, remove, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
addAll, remove, removeAll, retainAll |
| Methods inherited from interface java.util.List |
|---|
addAll, remove, removeAll, retainAll |
| Field Detail |
|---|
protected static final Localiser LOCALISER
protected Query query
protected boolean closed
protected java.util.List connectionListeners
| Constructor Detail |
|---|
public AbstractQueryResult(Query query)
query - The Query| Method Detail |
|---|
public void disconnect()
disconnect in interface QueryResultprotected abstract void closingConnection()
protected abstract void closeResults()
public void close()
close in interface QueryResultpublic void addConnectionListener(ManagedConnectionResourceListener listener)
listener - The listenerprotected boolean isOpen()
protected void assertIsOpen()
public void add(int index,
java.lang.Object element)
add in interface java.util.Listadd in class java.util.AbstractListindex - The position to addelement - The results to addpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Listadd in class java.util.AbstractListo - The result to add
public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.ListaddAll in class java.util.AbstractListindex - The position to addc - The results to add
public void clear()
clear in interface java.util.Collectionclear in interface java.util.Listclear in class java.util.AbstractListpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Listcontains in class java.util.AbstractCollectiono - The object
public boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.ListcontainsAll in class java.util.AbstractCollectionc - The collection of objects
public abstract boolean equals(java.lang.Object o)
equals in interface java.util.Collectionequals in interface java.util.Listequals in class java.util.AbstractListo - The object to compare against
public abstract java.lang.Object get(int index)
get in interface java.util.Listget in class java.util.AbstractListindex - The index of the element
public int hashCode()
hashCode in interface java.util.CollectionhashCode in interface java.util.ListhashCode in class java.util.AbstractListpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.ListindexOf in class java.util.AbstractListo - The result
public boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.ListisEmpty in class java.util.AbstractCollectionpublic abstract java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in class java.util.AbstractListpublic int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.ListlastIndexOf in class java.util.AbstractListo - The result
public abstract java.util.ListIterator listIterator()
listIterator in interface java.util.ListlistIterator in class java.util.AbstractListpublic java.lang.Object remove(int index)
remove in interface java.util.Listremove in class java.util.AbstractListindex - The position of the result.
public java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.Listset in class java.util.AbstractListindex - Position of the resultelement - The result
public abstract int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.AbstractCollection
public java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.ListsubList in class java.util.AbstractListfromIndex - start positiontoIndex - end position (exclusive)
public java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in class java.util.AbstractCollectionpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in class java.util.AbstractCollectiona - The array to copy into.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||