Package org.datanucleus.query.inmemory
Class InMemoryQueryResult
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList
-
- org.datanucleus.query.inmemory.InMemoryQueryResult
-
- All Implemented Interfaces:
Serializable,Iterable,Collection,List,QueryResult
public class InMemoryQueryResult extends AbstractList implements QueryResult, Serializable
Simple wrapper to results generated by the in-memory query process suitable for use by JDO/JPA.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanclosedWhether the results are close.-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description InMemoryQueryResult(List results, ApiAdapter api)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Object element)booleanadd(Object e)booleanaddAll(int index, Collection c)booleanaddAll(Collection c)protected voidassertIsOpen()Internal method to throw an Exception if the ResultSet is open.voidclear()voidclose()Method to close the results, making them unusable thereafter.booleancontains(Object o)booleancontainsAll(Collection c)voiddisconnect()Method to disconnect the results from the ExecutionContext, meaning that thereafter it just behaves like a List.Objectget(int index)intindexOf(Object o)booleanisEmpty()Iteratoriterator()intlastIndexOf(Object o)ListIteratorlistIterator()ListIteratorlistIterator(int index)Objectremove(int index)booleanremove(Object o)booleanremoveAll(Collection c)booleanretainAll(Collection c)Objectset(int index, Object element)intsize()ListsubList(int fromIndex, int toIndex)Object[]toArray()Object[]toArray(Object[] a)-
Methods inherited from class java.util.AbstractList
equals, hashCode, removeRange
-
Methods inherited from class java.util.AbstractCollection
toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Constructor Detail
-
InMemoryQueryResult
public InMemoryQueryResult(List results, ApiAdapter api)
-
-
Method Detail
-
close
public void close()
Description copied from interface:QueryResultMethod to close the results, making them unusable thereafter.- Specified by:
closein interfaceQueryResult
-
disconnect
public void disconnect()
Description copied from interface:QueryResultMethod to disconnect the results from the ExecutionContext, meaning that thereafter it just behaves like a List.- Specified by:
disconnectin interfaceQueryResult
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection- Specified by:
containsin interfaceList- Overrides:
containsin classAbstractCollection
-
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceList- Overrides:
containsAllin classAbstractCollection
-
get
public Object get(int index)
- Specified by:
getin interfaceList- Specified by:
getin classAbstractList
-
indexOf
public int indexOf(Object o)
- Specified by:
indexOfin interfaceList- Overrides:
indexOfin classAbstractList
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection- Specified by:
isEmptyin interfaceList- Overrides:
isEmptyin classAbstractCollection
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList- Overrides:
lastIndexOfin classAbstractList
-
subList
public List subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceList- Overrides:
subListin classAbstractList
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList- Overrides:
toArrayin classAbstractCollection
-
toArray
public Object[] toArray(Object[] a)
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList- Overrides:
toArrayin classAbstractCollection
-
size
public int size()
- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceList- Specified by:
sizein classAbstractCollection
-
iterator
public Iterator iterator()
- Specified by:
iteratorin interfaceCollection- Specified by:
iteratorin interfaceIterable- Specified by:
iteratorin interfaceList- Overrides:
iteratorin classAbstractList
-
listIterator
public ListIterator listIterator()
- Specified by:
listIteratorin interfaceList- Overrides:
listIteratorin classAbstractList
-
listIterator
public ListIterator listIterator(int index)
- Specified by:
listIteratorin interfaceList- Overrides:
listIteratorin classAbstractList
-
assertIsOpen
protected void assertIsOpen()
Internal method to throw an Exception if the ResultSet is open.
-
addAll
public boolean addAll(int index, Collection c)- Specified by:
addAllin interfaceList- Overrides:
addAllin classAbstractList
-
addAll
public boolean addAll(Collection c)
- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceList- Overrides:
addAllin classAbstractCollection
-
add
public boolean add(Object e)
- Specified by:
addin interfaceCollection- Specified by:
addin interfaceList- Overrides:
addin classAbstractList
-
add
public void add(int index, Object element)- Specified by:
addin interfaceList- Overrides:
addin classAbstractList
-
clear
public void clear()
- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceList- Overrides:
clearin classAbstractList
-
remove
public Object remove(int index)
- Specified by:
removein interfaceList- Overrides:
removein classAbstractList
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection- Specified by:
removein interfaceList- Overrides:
removein classAbstractCollection
-
removeAll
public boolean removeAll(Collection c)
- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceList- Overrides:
removeAllin classAbstractCollection
-
retainAll
public boolean retainAll(Collection c)
- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceList- Overrides:
retainAllin classAbstractCollection
-
-