Class Paginator
- All Implemented Interfaces:
Iterable<AlbumObject>,Collection<AlbumObject>
Simplify iterating over groups ("pages") of album objects of current folder
The various counter methods (size(), totalPages(), totalSize()) reflects the
various filters set up. This class uses a "fluent" API, returning itself in a
modified state. Use reset() to reset it to initial state.
Will always ignore excluded and hidden objects
An instance of this class is available via the "children" variable during processing of index.htt and within jAlbum's system console.
- Since:
- 33
-
Constructor Summary
ConstructorsConstructorDescriptionPaginator(AlbumBean engine, Collection<AlbumObject> allItems) Paginator(AlbumBean engine, AlbumObject currentFolder) Create a copy -
Method Summary
Modifier and TypeMethodDescriptiondirs()Include directories only (convenience for include(Category.folder))Exclude one or several file typesExclude one or several categoriesfilter(Predicate<AlbumObject> filter) Add a custom filterintintgetPage()Include one or several file types.Include one or several categories.iterator()nodirs()Exclude directories (convenience for exclude(Category.folder))page(int page) Set current page to iterate over, starting with 0.reset()Reset Paginator to initial stateintsize()Convenience to exclude directories, pages and web locationsintintMethods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
Paginator
-
Paginator
-
Paginator
-
-
Method Details
-
page
Set current page to iterate over, starting with 0. Set to -1 to iterate over all pages- Parameters:
page-- Returns:
- new Paginator specific for this page
-
getPage
public int getPage()- Returns:
- Current page or -1 if no paging has been set
-
size
public int size()- Specified by:
sizein interfaceCollection<AlbumObject>- Specified by:
sizein classAbstractCollection<AlbumObject>- Returns:
- Number of items in current page
-
totalSize
public int totalSize()- Returns:
- Total number of items in current folder
-
totalPages
public int totalPages()- Returns:
- Total number of pages in current folder
-
getItemsPerPage
public int getItemsPerPage() -
include
-
exclude
-
include
-
exclude
-
dirs
Include directories only (convenience for include(Category.folder))- Returns:
-
nodirs
-
thumbnails
-
filter
Add a custom filter- Parameters:
filter-- Returns:
-
reset
-
iterator
- Specified by:
iteratorin interfaceCollection<AlbumObject>- Specified by:
iteratorin interfaceIterable<AlbumObject>- Specified by:
iteratorin classAbstractCollection<AlbumObject>
-