Class InMemoryQueryResult
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList
-
- org.datanucleus.store.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 boolean
closed
Whether 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 void
add(int index, Object element)
boolean
add(Object e)
boolean
addAll(int index, Collection c)
boolean
addAll(Collection c)
protected void
assertIsOpen()
Internal method to throw an Exception if the ResultSet is open.void
clear()
void
close()
Method to close the results, making them unusable thereafter.boolean
contains(Object o)
boolean
containsAll(Collection c)
void
disconnect()
Method to disconnect the results from the ExecutionContext, meaning that thereafter it just behaves like a List.Object
get(int index)
int
indexOf(Object o)
boolean
isEmpty()
Iterator
iterator()
int
lastIndexOf(Object o)
ListIterator
listIterator()
ListIterator
listIterator(int index)
Object
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection c)
boolean
retainAll(Collection c)
Object
set(int index, Object element)
int
size()
List
subList(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:QueryResult
Method to close the results, making them unusable thereafter.- Specified by:
close
in interfaceQueryResult
-
disconnect
public void disconnect()
Description copied from interface:QueryResult
Method to disconnect the results from the ExecutionContext, meaning that thereafter it just behaves like a List.- Specified by:
disconnect
in interfaceQueryResult
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection
- Specified by:
contains
in interfaceList
- Overrides:
contains
in classAbstractCollection
-
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAll
in interfaceCollection
- Specified by:
containsAll
in interfaceList
- Overrides:
containsAll
in classAbstractCollection
-
get
public Object get(int index)
- Specified by:
get
in interfaceList
- Specified by:
get
in classAbstractList
-
indexOf
public int indexOf(Object o)
- Specified by:
indexOf
in interfaceList
- Overrides:
indexOf
in classAbstractList
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection
- Specified by:
isEmpty
in interfaceList
- Overrides:
isEmpty
in classAbstractCollection
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList
- Overrides:
lastIndexOf
in classAbstractList
-
subList
public List subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceList
- Overrides:
subList
in classAbstractList
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection
- Specified by:
toArray
in interfaceList
- Overrides:
toArray
in classAbstractCollection
-
toArray
public Object[] toArray(Object[] a)
- Specified by:
toArray
in interfaceCollection
- Specified by:
toArray
in interfaceList
- Overrides:
toArray
in classAbstractCollection
-
size
public int size()
- Specified by:
size
in interfaceCollection
- Specified by:
size
in interfaceList
- Specified by:
size
in classAbstractCollection
-
iterator
public Iterator iterator()
- Specified by:
iterator
in interfaceCollection
- Specified by:
iterator
in interfaceIterable
- Specified by:
iterator
in interfaceList
- Overrides:
iterator
in classAbstractList
-
listIterator
public ListIterator listIterator()
- Specified by:
listIterator
in interfaceList
- Overrides:
listIterator
in classAbstractList
-
listIterator
public ListIterator listIterator(int index)
- Specified by:
listIterator
in interfaceList
- Overrides:
listIterator
in 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:
addAll
in interfaceList
- Overrides:
addAll
in classAbstractList
-
addAll
public boolean addAll(Collection c)
- Specified by:
addAll
in interfaceCollection
- Specified by:
addAll
in interfaceList
- Overrides:
addAll
in classAbstractCollection
-
add
public boolean add(Object e)
- Specified by:
add
in interfaceCollection
- Specified by:
add
in interfaceList
- Overrides:
add
in classAbstractList
-
add
public void add(int index, Object element)
- Specified by:
add
in interfaceList
- Overrides:
add
in classAbstractList
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection
- Specified by:
clear
in interfaceList
- Overrides:
clear
in classAbstractList
-
remove
public Object remove(int index)
- Specified by:
remove
in interfaceList
- Overrides:
remove
in classAbstractList
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection
- Specified by:
remove
in interfaceList
- Overrides:
remove
in classAbstractCollection
-
removeAll
public boolean removeAll(Collection c)
- Specified by:
removeAll
in interfaceCollection
- Specified by:
removeAll
in interfaceList
- Overrides:
removeAll
in classAbstractCollection
-
retainAll
public boolean retainAll(Collection c)
- Specified by:
retainAll
in interfaceCollection
- Specified by:
retainAll
in interfaceList
- Overrides:
retainAll
in classAbstractCollection
-
-