|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> org.jivesoftware.openfire.resultsetmanager.ResultSet<E> org.jivesoftware.openfire.resultsetmanager.ResultSetImpl<E>
E
- Each result set should be a collection of instances of the exact
same class. This class must implement the Result
interface.ResultSetImpl
@Deprecated public class ResultSetImpl<E extends Result>
A result set representation as described in XEP-0059. Note that this result
'set' actually makes use of a List implementations, as the Java Set
definition disallows duplicate elements, while the List definition supplies
most of the required indexing operations.
This ResultSet implementation loads all all results from the set into memory,
which might be undesirable for very large sets, or for sets where the
retrieval of a result is an expensive operation. sets.
As most methods are backed by the List.subList(int, int)
method,
non-structural changes in the returned lists are reflected in the ResultSet,
and vice-versa.
List.subList(int, int)
Field Summary | |
---|---|
List<E> |
resultList
Deprecated. A list of all results in this ResultSet |
Map<String,Integer> |
uidToIndex
Deprecated. A mapping of the UIDs of all results in resultList, to the index of those entries in that list. |
Fields inherited from class org.jivesoftware.openfire.resultsetmanager.ResultSet |
---|
NAMESPACE_RESULT_SET_MANAGEMENT |
Constructor Summary | |
---|---|
ResultSetImpl(Collection<E> results)
Deprecated. Creates a new Result Set instance, based on a collection of Result implementing objects. |
|
ResultSetImpl(Collection<E> results,
Comparator<E> comparator)
Deprecated. Creates a new Result Set instance, based on a collection of Result implementing objects. |
Method Summary | |
---|---|
E |
get(int index)
Deprecated. Returns the element denoted by the index. |
List<E> |
get(int fromIndex,
int maxAmount)
Deprecated. Returns a list of results, starting with the result that's at the specified index. |
List<E> |
getAfter(String uid,
int maxAmount)
Deprecated. Returns a List of results starting with the first result after the result that's identified by the provided UID (the returned List is exclusive). |
List<E> |
getBefore(String uid,
int maxAmount)
Deprecated. Returns a list of results ending with the element right before the element identified by the provided UID (the returned List is exclusive). |
List<E> |
getFirst(int maxAmount)
Deprecated. Returns the first elements from this result set. |
List<E> |
getLast(int maxAmount)
Deprecated. Returns the last elements from this result set. |
int |
indexOf(String uid)
Deprecated. Returns the index in the full resultset of the element identified by the UID in te supplied argument. |
int |
size()
Deprecated. |
Methods inherited from class org.jivesoftware.openfire.resultsetmanager.ResultSet |
---|
applyRSMDirectives, generateSetElementFromResults, getAfter, getBefore, getUID, indexOf, isValidRSMRequest, iterator |
Methods inherited from class java.util.AbstractCollection |
---|
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Field Detail |
---|
public final List<E extends Result> resultList
public final Map<String,Integer> uidToIndex
Constructor Detail |
---|
public ResultSetImpl(Collection<E> results)
Collection.iterator()
iterates over the
collection.
Note that this constructor throws an IllegalArgumentException if the
Collection that is provided contains Results that have duplicate UIDs.
results
- The collection of Results that make up this result set.public ResultSetImpl(Collection<E> results, Comparator<E> comparator)
results
- The collection of Results that make up this result set.comparator
- The Comparator that defines the order of the Results in this
result set.Method Detail |
---|
public int size()
size
in interface Collection<E extends Result>
size
in class AbstractCollection<E extends Result>
public List<E> getAfter(String uid, int maxAmount)
ResultSet
getAfter
in class ResultSet<E extends Result>
uid
- The UID of the element that is right before the first element
in the result.maxAmount
- The maximum number of elements to return.
public List<E> getBefore(String uid, int maxAmount)
ResultSet
getBefore
in class ResultSet<E extends Result>
uid
- The UID of the element preceding the last element returned by
this function.maxAmount
- The length of the List that is being returned.
public E get(int index)
ResultSet
get
in class ResultSet<E extends Result>
index
- Index of the element to be returned
public List<E> getFirst(int maxAmount)
ResultSet
getFirst
in class ResultSet<E extends Result>
maxAmount
- the number of elements to return.
public List<E> getLast(int maxAmount)
ResultSet
getLast
in class ResultSet<E extends Result>
maxAmount
- the number of elements to return.
public List<E> get(int fromIndex, int maxAmount)
ResultSet
get
in class ResultSet<E extends Result>
fromIndex
- The index of the first element to be returned.maxAmount
- The maximum number of elements to return.
public int indexOf(String uid)
ResultSet
indexOf
in class ResultSet<E extends Result>
uid
- The UID of the element to search for
|
Openfire 3.9.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |