Package org.opencms.cmis
Class CmsObjectListLimiter<A>
- java.lang.Object
-
- org.opencms.cmis.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()
-
-
-
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 iteratemaxItems
- the maximum number of itemsskipCount
- 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 interfacejava.util.Iterator<A>
- See Also:
Iterator.hasNext()
-
iterator
public java.util.Iterator<A> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<A>
- See Also:
Iterable.iterator()
-
next
public A next()
- Specified by:
next
in interfacejava.util.Iterator<A>
- See Also:
Iterator.next()
-
-