Class CmsObjectListLimiter<A>

  • Type Parameters:
    A - the content type of the list
    All Implemented Interfaces:
    java.lang.Iterable<A>, java.util.Iterator<A>

    public class CmsObjectListLimiter<A>
    extends java.lang.Object
    implements java.lang.Iterable<A>, java.util.Iterator<A>
    Helper class to ease implementation of CMIS service methods which support paging.

    This class works as an iterator for a given list, and limits the number of iterations based on skip/max parameters which are usually passed to the service methods.

    • Constructor Summary

      Constructors 
      Constructor Description
      CmsObjectListLimiter​(java.util.List<A> baseList, java.math.BigInteger maxItems, java.math.BigInteger skipCount)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasMore()
      Checks if there are more items left in the base list which were not returned.
      boolean hasNext()  
      java.util.Iterator<A> iterator()  
      A next()  
      void remove()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • CmsObjectListLimiter

        public CmsObjectListLimiter​(java.util.List<A> baseList,
                                    java.math.BigInteger maxItems,
                                    java.math.BigInteger skipCount)
        Creates a new instance.

        Parameters:
        baseList - the list over which we want to iterate
        maxItems - the maximum number of items
        skipCount - the number of items to skip
    • Method Detail

      • hasMore

        public boolean hasMore()
        Checks if there are more items left in the base list which were not returned.

        Returns:
        true if there are more items left in the base list which were not returned
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<A>
        See Also:
        Iterator.hasNext()
      • iterator

        public java.util.Iterator<Aiterator()
        Specified by:
        iterator in interface java.lang.Iterable<A>
        See Also:
        Iterable.iterator()
      • next

        public A next()
        Specified by:
        next in interface java.util.Iterator<A>
        See Also:
        Iterator.next()
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<A>
        See Also:
        Iterator.remove()