T
- Class of the Elementspublic class QueryResultList<T> extends AbstractList<T> implements Sortable, Serializable
If you know you will use many elements of the List use the subList method to load a complete range of elements in a unmodifiable List. This is how such lists are used by the Frontend
A QueryResultList is unmodifiable. Every call of a add or remove method will result in a UnsupportedOperationException.
If the database has changed before you call a get or subList method you may
get null
as element or a unexpected reduced sub list. You don't
get an exception in that cases.
QueryResultList is Sortable. The order of the elements can be changed at any time. The size of the List is not recalculated and the sub List created before a sort are not updated. Of course this is mainly used by a Frontend. Business methods should execute a new find on the Repository / Backend.
modCount
Constructor and Description |
---|
QueryResultList(Repository repository,
Class<T> clazz,
Query query) |
Modifier and Type | Method and Description |
---|---|
boolean |
canSortBy(Object sortKey) |
T |
get(int index) |
int |
size() |
void |
sort(Object[] sortKeys,
boolean[] sortDirections) |
List<T> |
subList(int fromIndex,
int toIndex) |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public QueryResultList(Repository repository, Class<T> clazz, Query query)
public T get(int index)
public int size()
size
in interface Collection<T>
size
in interface List<T>
size
in class AbstractCollection<T>
public void sort(Object[] sortKeys, boolean[] sortDirections)
Copyright © 2019. All rights reserved.