Class InMemoryQueryResult

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.List, QueryResult

    public class InMemoryQueryResult
    extends java.util.AbstractList
    implements QueryResult, java.io.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
      (package private) ApiAdapter api  
      protected boolean closed
      Whether the results are close.
      (package private) java.util.List results  
      private static long serialVersionUID  
      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, java.lang.Object element)  
      boolean add​(java.lang.Object e)  
      boolean addAll​(int index, java.util.Collection c)  
      boolean addAll​(java.util.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​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection c)  
      void disconnect()
      Method to disconnect the results from the ExecutionContext, meaning that thereafter it just behaves like a List.
      java.lang.Object get​(int index)  
      int indexOf​(java.lang.Object o)  
      boolean isEmpty()  
      java.util.Iterator iterator()  
      int lastIndexOf​(java.lang.Object o)  
      java.util.ListIterator listIterator()  
      java.util.ListIterator listIterator​(int index)  
      java.lang.Object remove​(int index)  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection c)  
      boolean retainAll​(java.util.Collection c)  
      java.lang.Object set​(int index, java.lang.Object element)  
      int size()  
      java.util.List subList​(int fromIndex, int toIndex)  
      java.lang.Object[] toArray()  
      java.lang.Object[] toArray​(java.lang.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
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        replaceAll, sort, spliterator
    • Field Detail

      • results

        java.util.List results
      • closed

        protected boolean closed
        Whether the results are close.
    • Constructor Detail

      • InMemoryQueryResult

        public InMemoryQueryResult​(java.util.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 interface QueryResult
      • 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 interface QueryResult
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection
        Specified by:
        contains in interface java.util.List
        Overrides:
        contains in class java.util.AbstractCollection
      • containsAll

        public boolean containsAll​(java.util.Collection c)
        Specified by:
        containsAll in interface java.util.Collection
        Specified by:
        containsAll in interface java.util.List
        Overrides:
        containsAll in class java.util.AbstractCollection
      • get

        public java.lang.Object get​(int index)
        Specified by:
        get in interface java.util.List
        Specified by:
        get in class java.util.AbstractList
      • indexOf

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List
        Overrides:
        indexOf in class java.util.AbstractList
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection
        Specified by:
        isEmpty in interface java.util.List
        Overrides:
        isEmpty in class java.util.AbstractCollection
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List
        Overrides:
        lastIndexOf in class java.util.AbstractList
      • subList

        public java.util.List subList​(int fromIndex,
                                      int toIndex)
        Specified by:
        subList in interface java.util.List
        Overrides:
        subList in class java.util.AbstractList
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
        Overrides:
        toArray in class java.util.AbstractCollection
      • toArray

        public java.lang.Object[] toArray​(java.lang.Object[] a)
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
        Overrides:
        toArray in class java.util.AbstractCollection
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection
        Specified by:
        size in interface java.util.List
        Specified by:
        size in class java.util.AbstractCollection
      • iterator

        public java.util.Iterator iterator()
        Specified by:
        iterator in interface java.util.Collection
        Specified by:
        iterator in interface java.lang.Iterable
        Specified by:
        iterator in interface java.util.List
        Overrides:
        iterator in class java.util.AbstractList
      • listIterator

        public java.util.ListIterator listIterator()
        Specified by:
        listIterator in interface java.util.List
        Overrides:
        listIterator in class java.util.AbstractList
      • listIterator

        public java.util.ListIterator listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List
        Overrides:
        listIterator in class java.util.AbstractList
      • assertIsOpen

        protected void assertIsOpen()
        Internal method to throw an Exception if the ResultSet is open.
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection c)
        Specified by:
        addAll in interface java.util.List
        Overrides:
        addAll in class java.util.AbstractList
      • addAll

        public boolean addAll​(java.util.Collection c)
        Specified by:
        addAll in interface java.util.Collection
        Specified by:
        addAll in interface java.util.List
        Overrides:
        addAll in class java.util.AbstractCollection
      • add

        public boolean add​(java.lang.Object e)
        Specified by:
        add in interface java.util.Collection
        Specified by:
        add in interface java.util.List
        Overrides:
        add in class java.util.AbstractList
      • add

        public void add​(int index,
                        java.lang.Object element)
        Specified by:
        add in interface java.util.List
        Overrides:
        add in class java.util.AbstractList
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection
        Specified by:
        clear in interface java.util.List
        Overrides:
        clear in class java.util.AbstractList
      • remove

        public java.lang.Object remove​(int index)
        Specified by:
        remove in interface java.util.List
        Overrides:
        remove in class java.util.AbstractList
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection
        Specified by:
        remove in interface java.util.List
        Overrides:
        remove in class java.util.AbstractCollection
      • removeAll

        public boolean removeAll​(java.util.Collection c)
        Specified by:
        removeAll in interface java.util.Collection
        Specified by:
        removeAll in interface java.util.List
        Overrides:
        removeAll in class java.util.AbstractCollection
      • retainAll

        public boolean retainAll​(java.util.Collection c)
        Specified by:
        retainAll in interface java.util.Collection
        Specified by:
        retainAll in interface java.util.List
        Overrides:
        retainAll in class java.util.AbstractCollection
      • set

        public java.lang.Object set​(int index,
                                    java.lang.Object element)
        Specified by:
        set in interface java.util.List
        Overrides:
        set in class java.util.AbstractList