public class BasicUserHistory<E extends Event> extends AbstractUserHistory<E> implements UserHistory<E>
Basic user rating profile backed by a collection of ratings. The event list aspects of the profile are implemented as a read-only delegation to an underlying list.
History.forUser(long, List)
modCount
Modifier and Type | Method and Description |
---|---|
<T extends Event> |
filter(Class<T> type)
Filter the user history to only contain elements of a particular type.
|
UserHistory<E> |
filter(Predicate<? super E> pred)
Filter the user history with a predicate.
|
E |
get(int i) |
long |
getUserId()
Retrieve the user ID.
|
Iterator<E> |
iterator() |
int |
size() |
List<E> |
subList(int from,
int to) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
itemSet, memoize
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
itemSet, memoize
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator
parallelStream, removeIf, stream
public long getUserId()
UserHistory
Retrieve the user ID.
getUserId
in interface UserHistory<E extends Event>
public E get(int i)
public int size()
public Object[] toArray()
public <T> T[] toArray(T[] a)
public <T extends Event> UserHistory<T> filter(Class<T> type)
Filter the user history to only contain elements of a particular type.
This implementation filters into a new BasicUserHistory
backed by an ArrayList
.
filter
in interface UserHistory<E extends Event>
type
- The type of elements to include.public UserHistory<E> filter(Predicate<? super E> pred)
Filter the user history with a predicate.
This implementation filters into a new BasicUserHistory
backed by an ArrayList
.
filter
in interface UserHistory<E extends Event>
pred
- The predicate to with which to filter the history.