public abstract class AbstractQueryResult extends AbstractList implements QueryResult, Serializable
Modifier and Type | Field and Description |
---|---|
protected boolean |
closed
Whether the results are close.
|
protected List<ManagedConnectionResourceListener> |
connectionListeners
List of listeners to notify when the query results are closed.
|
protected boolean |
loadResultsAtCommit
Whether to load any unread results at commit (when connection is closed).
|
protected static Localiser |
LOCALISER
Localiser for messages.
|
protected Query |
query
The Query object.
|
protected String |
resultSizeMethod
Method for getting the size of the results.
|
protected int |
size
size of the query results.
|
modCount
Constructor and Description |
---|
AbstractQueryResult(Query query)
Constructor of the result from a Query.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Object element)
Method to add a result.
|
boolean |
add(Object o)
Method to add results.
|
boolean |
addAll(int index,
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(Object o)
Method to check if the specified object is contained in this result.
|
boolean |
containsAll(Collection c)
Method to check if all of the specified objects are contained here.
|
void |
disconnect()
Method to disconnect the results from the ExecutionContext, meaning that thereafter it just behaves
like a List.
|
abstract boolean |
equals(Object o)
Equality operator for QueryResults.
|
abstract Object |
get(int index)
Method to retrieve a particular element from the list.
|
protected int |
getSizeUsingMethod()
Method to get the size using the "resultSizeMethod".
|
int |
hashCode()
Accessor for the hashcode of this object
|
int |
indexOf(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 Iterator |
iterator()
Accessor for an iterator for the results.
|
int |
lastIndexOf(Object o)
Method to check the last index of a result.
|
abstract ListIterator |
listIterator()
Accessor for a list iterator for the results.
|
Object |
remove(int index)
Method to remove a result.
|
Object |
set(int index,
Object element)
Method to set the position of a result.
|
int |
size()
Method to return the size of the result.
|
List |
subList(int fromIndex,
int toIndex)
Method return a sub list of results.
|
Object[] |
toArray()
Method to return the results as an array.
|
Object[] |
toArray(Object[] a)
Method to return the results as an array.
|
listIterator, removeRange
addAll, remove, removeAll, retainAll, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream
addAll, remove, removeAll, replaceAll, retainAll, sort, spliterator
protected static final Localiser LOCALISER
protected boolean closed
protected Query query
protected List<ManagedConnectionResourceListener> connectionListeners
protected int size
protected String resultSizeMethod
protected boolean loadResultsAtCommit
public AbstractQueryResult(Query query)
query
- The Querypublic void disconnect()
disconnect
in interface QueryResult
protected abstract void closingConnection()
protected abstract void closeResults()
public void close()
close
in interface QueryResult
public void addConnectionListener(ManagedConnectionResourceListener listener)
listener
- The listenerprotected boolean isOpen()
protected void assertIsOpen()
public void add(int index, Object element)
add
in interface List
add
in class AbstractList
index
- The position to addelement
- The results to addpublic boolean add(Object o)
add
in interface Collection
add
in interface List
add
in class AbstractList
o
- The result to addpublic boolean addAll(int index, Collection c)
addAll
in interface List
addAll
in class AbstractList
index
- The position to addc
- The results to addpublic void clear()
clear
in interface Collection
clear
in interface List
clear
in class AbstractList
public boolean contains(Object o)
contains
in interface Collection
contains
in interface List
contains
in class AbstractCollection
o
- The objectpublic boolean containsAll(Collection c)
containsAll
in interface Collection
containsAll
in interface List
containsAll
in class AbstractCollection
c
- The collection of objectspublic abstract boolean equals(Object o)
equals
in interface Collection
equals
in interface List
equals
in class AbstractList
o
- The object to compare againstpublic abstract Object get(int index)
get
in interface List
get
in class AbstractList
index
- The index of the elementpublic int hashCode()
hashCode
in interface Collection
hashCode
in interface List
hashCode
in class AbstractList
public int indexOf(Object o)
indexOf
in interface List
indexOf
in class AbstractList
o
- The resultpublic boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface List
isEmpty
in class AbstractCollection
public abstract Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in interface List
iterator
in class AbstractList
public int lastIndexOf(Object o)
lastIndexOf
in interface List
lastIndexOf
in class AbstractList
o
- The resultpublic abstract ListIterator listIterator()
listIterator
in interface List
listIterator
in class AbstractList
public Object remove(int index)
remove
in interface List
remove
in class AbstractList
index
- The position of the result.public Object set(int index, Object element)
set
in interface List
set
in class AbstractList
index
- Position of the resultelement
- The resultpublic int size()
size
in interface Collection
size
in interface List
size
in class AbstractCollection
public List subList(int fromIndex, int toIndex)
subList
in interface List
subList
in class AbstractList
fromIndex
- start positiontoIndex
- end position (exclusive)public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
toArray
in class AbstractCollection
public Object[] toArray(Object[] a)
toArray
in interface Collection
toArray
in interface List
toArray
in class AbstractCollection
a
- The array to copy into.protected int getSizeUsingMethod()
Copyright © 2019. All rights reserved.