Class ObjectSetFacade

  • All Implemented Interfaces:
    ExtObjectSet, ObjectSet, java.lang.Iterable, java.util.Collection, java.util.List

    public class ObjectSetFacade
    extends java.util.AbstractList
    implements ExtObjectSet
    • Field Summary

      Fields 
      Modifier and Type Field Description
      StatefulQueryResult _delegate  
      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.Object obj)  
      ExtObjectSet ext()
      Returns an ObjectSet with extended functionality.
      java.lang.Object get​(int index)
      returns the item at position [index] in this ObjectSet.
      long[] getIDs()
      returns an array of internal IDs that correspond to the contained objects.
      boolean hasNext()
      Returns true if the ObjectSet has more elements.
      int indexOf​(java.lang.Object obj)  
      java.util.Iterator iterator()  
      int lastIndexOf​(java.lang.Object obj)  
      java.lang.Object next()
      Returns the next object in the ObjectSet.
      void remove()  
      void reset()
      Resets the ObjectSet cursor before the first element.
      int size()
      Returns the number of elements in the ObjectSet.
      void skip​(int count)
      skips the specified number of objects without activating them.
      void sort​(QueryComparator cmp)  
      • Methods inherited from class java.util.AbstractList

        add, add, addAll, clear, equals, hashCode, listIterator, listIterator, remove, removeRange, set, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, 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.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        add, add, addAll, addAll, clear, containsAll, equals, hashCode, isEmpty, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
    • Constructor Detail

      • ObjectSetFacade

        public ObjectSetFacade​(QueryResult queryResult)
    • Method Detail

      • skip

        public void skip​(int count)
        Description copied from interface: ExtObjectSet
        skips the specified number of objects without activating them. Call this method before starting iterating over the iterator returned by List.iterator(). This method has no effect on calls to ExtObjectSet.get(int)
        Specified by:
        skip in interface ExtObjectSet
      • 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
      • ext

        public ExtObjectSet ext()
        Description copied from interface: ObjectSet
        Returns an ObjectSet with extended functionality.

        Every ObjectSet that db4o provides can be casted to an ExtObjectSet. This method is supplied for your convenience to work without a cast.

        The ObjectSet functionality is split to two interfaces to allow newcomers to focus on the essential methods.
        Specified by:
        ext in interface ObjectSet
      • hasNext

        public boolean hasNext()
        Description copied from interface: ObjectSet
        Returns true if the ObjectSet has more elements.
        Specified by:
        hasNext in interface ObjectSet
        Returns:
        boolean - true if the ObjectSet has more elements.
      • next

        public java.lang.Object next()
        Description copied from interface: ObjectSet
        Returns the next object in the ObjectSet.

        Before returning the object, next() triggers automatic activation of the object with the respective global or class specific setting.

        Specified by:
        next in interface ObjectSet
        Returns:
        the next object in the ObjectSet.
      • reset

        public void reset()
        Description copied from interface: ObjectSet
        Resets the ObjectSet cursor before the first element. A subsequent call to ObjectSet.next() will return the first element.
        Specified by:
        reset in interface ObjectSet
      • size

        public int size()
        Description copied from interface: ObjectSet
        Returns the number of elements in the ObjectSet.
        Specified by:
        size in interface java.util.Collection
        Specified by:
        size in interface java.util.List
        Specified by:
        size in interface ObjectSet
        Specified by:
        size in class java.util.AbstractCollection
        Returns:
        the number of elements in the ObjectSet.
      • contains

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

        public java.lang.Object get​(int index)
        Description copied from interface: ExtObjectSet
        returns the item at position [index] in this ObjectSet.

        The object will be activated.
        Specified by:
        get in interface ExtObjectSet
        Specified by:
        get in interface java.util.List
        Specified by:
        get in class java.util.AbstractList
        Parameters:
        index - the index position in this ObjectSet.
        Returns:
        the activated object.
      • indexOf

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

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

        public void remove()