public interface ResultSetProvider<T extends ResultSetItem>
Provides methods which are needed for result set management.
Modifier and Type | Method and Description |
---|---|
static <T extends ResultSetItem> |
forItems(java.util.Collection<T> items)
Creates a
Collection -based result set provider. |
int |
getItemCount()
Gets the total item count.
|
java.util.List<T> |
getItems()
Gets all items.
|
java.util.List<T> |
getItems(int index,
int maxSize)
Gets the items in a specific range (by index).
|
java.util.List<T> |
getItemsAfter(java.lang.String itemId,
int maxSize)
Gets the items after a specific item, which is determined by an item id.
|
java.util.List<T> |
getItemsBefore(java.lang.String itemId,
int maxSize)
Gets the items before a specific item, which is determined by an item id.
|
int |
indexOf(java.lang.String itemId)
Gets the index of a specific item.
|
java.util.List<T> getItems()
Gets all items. This method is called, if no result set management was included in the query.
int getItemCount()
Gets the total item count.
java.util.List<T> getItems(int index, int maxSize)
Gets the items in a specific range (by index).
index
- The index.maxSize
- The maximal size of items.java.util.List<T> getItemsAfter(java.lang.String itemId, int maxSize)
Gets the items after a specific item, which is determined by an item id.
itemId
- The item id.maxSize
- The maximal size of items.java.util.List<T> getItemsBefore(java.lang.String itemId, int maxSize)
Gets the items before a specific item, which is determined by an item id.
itemId
- The item id.maxSize
- The maximal size of items.int indexOf(java.lang.String itemId)
Gets the index of a specific item.
itemId
- The item id.static <T extends ResultSetItem> ResultSetProvider<T> forItems(java.util.Collection<T> items)
Creates a Collection
-based result set provider.
It is highly recommended that the provided list is thread-safe, e.g. by using Collections.synchronizedList(List)
} or a concurrent collection. Otherwise modifications on the list, while reading a sub list (getItems(int, int)
) may produce ConcurrentModificationException
.
T
- The result set item.items
- The items.Copyright © 2014–2019 XMPP.rocks. All rights reserved.