Package net.storm.api.query.results
Class QueryResults<T,R>
- java.lang.Object
-
- net.storm.api.query.results.QueryResults<T,R>
-
- All Implemented Interfaces:
java.lang.Iterable<T>
,java.util.Collection<T>
- Direct Known Subclasses:
ItemQueryResults
,SceneEntityQueryResults
,WidgetQueryResults
public abstract class QueryResults<T,R> extends java.lang.Object implements java.util.Collection<T>
-
-
Constructor Summary
Constructors Constructor Description QueryResults(java.util.List<T> results)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(java.util.function.Consumer<T> consumer, java.util.function.Function<R,T> target)
boolean
add(T t)
boolean
addAll(java.util.Collection<? extends T> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
T
first()
T
get(int index)
int
indexOf(T o)
boolean
isEmpty()
boolean
isNotEmpty()
java.util.Iterator<T>
iterator()
T
last()
int
lastIndexOf(T o)
R
limit(int entries)
R
limit(int startIndex, int amount)
java.util.List<T>
list()
T
random()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
R
reversed()
R
shuffled()
int
size()
R
sorted(java.util.Comparator<? super T> comparator)
java.lang.Object[]
toArray()
T[]
toArray(java.lang.Object[] o)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
results
protected final java.util.List<T> results
-
-
Constructor Detail
-
QueryResults
public QueryResults(java.util.List<T> results)
-
-
Method Detail
-
get
public T get(int index)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<T>
-
isNotEmpty
public boolean isNotEmpty()
-
lastIndexOf
public int lastIndexOf(T o)
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
- Specified by:
addAll
in interfacejava.util.Collection<T>
-
limit
public final R limit(int startIndex, int amount)
-
list
public java.util.List<T> list()
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<T>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<T>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<T>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<T>
-
reversed
public final R reversed()
-
first
public T first()
-
indexOf
public int indexOf(T o)
-
accept
public final boolean accept(java.util.function.Consumer<T> consumer, java.util.function.Function<R,T> target)
-
random
public final T random()
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<T>
-
shuffled
public final R shuffled()
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<T>
-
iterator
public java.util.Iterator<T> iterator()
-
limit
public final R limit(int entries)
-
last
public final T last()
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<T>
-
toArray
public T[] toArray(java.lang.Object[] o)
- Specified by:
toArray
in interfacejava.util.Collection<T>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<T>
-
-