|
Openfire 3.6.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>
E
- Each result set should be a collection of instances of the exact
same class. This class must implement the Result
interface.public abstract class ResultSet<E extends Result>
A result set representation as described in XEP-0059. A result set is a collection of objects that each have a unique identifier (UID). It's expected that some implementations will have the complete result set loaded into memory, whereas more complex implementations might keep references to partial sets only. This latter would have considerable advantages if the result set is extremely large, or if the operation to get all results in the set is expensive.
Field Summary | |
---|---|
static String |
NAMESPACE_RESULT_SET_MANAGEMENT
The namespace that identifies Result Set Management functionality. |
Constructor Summary | |
---|---|
ResultSet()
|
Method Summary | |
---|---|
List<E> |
applyRSMDirectives(org.dom4j.Element rsmElement)
Applies the 'result set management' directives to this result set, and returns a list of Results that matches the directives. |
org.dom4j.Element |
generateSetElementFromResults(List<E> returnedResults)
Generates a Result Set Management 'set' element that describes the parto of the result set that was generated. |
abstract E |
get(int index)
Returns the element denoted by the index. |
abstract List<E> |
get(int fromIndex,
int maxAmount)
Returns a list of results, starting with the result that's at the specified index. |
List<E> |
getAfter(E result,
int maxAmount)
Returns a List of results starting with the first result after the provided result (the returned List is exclusive). |
abstract List<E> |
getAfter(String uid,
int maxAmount)
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(E result,
int maxAmount)
Returns a list of results ending with the element right before the provided result (the returned List is exclusive). |
abstract List<E> |
getBefore(String uid,
int maxAmount)
Returns a list of results ending with the element right before the element identified by the provided UID (the returned List is exclusive). |
abstract List<E> |
getFirst(int maxAmount)
Returns the first elements from this result set. |
abstract List<E> |
getLast(int maxAmount)
Returns the last elements from this result set. |
String |
getUID(int index)
Returns the UID of the object at the specified index in this result set. |
int |
indexOf(E element)
Returns the index in the full resultset of the supplied argument. |
abstract int |
indexOf(String uid)
Returns the index in the full resultset of the element identified by the UID in te supplied argument. |
static boolean |
isValidRSMRequest(org.dom4j.Element rsmElement)
Checks if the Element that has been passed as an argument is a valid Result Set Management element, in a request context. |
Iterator<E> |
iterator()
|
Methods inherited from class java.util.AbstractCollection |
---|
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, 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 static final String NAMESPACE_RESULT_SET_MANAGEMENT
Constructor Detail |
---|
public ResultSet()
Method Detail |
---|
public List<E> getAfter(E result, int maxAmount)
result
- The element that is right before the first element in the
result.maxAmount
- The maximum number of elements to return.
NullPointerException
- if the result does not exist in the result set.public abstract List<E> getAfter(String uid, int maxAmount)
uid
- The UID of the element that is right before the first element
in the result.maxAmount
- The maximum number of elements to return.
NullPointerException
- if there is no result in the result set that matches the UID.public List<E> getBefore(E result, int maxAmount)
result
- The element preceding the last element returned by this
function.maxAmount
- The length of the List that is being returned.
NullPointerException
- if the result does not exist in the result set.public abstract List<E> getBefore(String uid, int maxAmount)
uid
- The UID of the element preceding the last element returned by
this function.maxAmount
- The length of the List that is being returned.
NullPointerException
- if there is no result in the result set that matches the UID.public abstract List<E> getFirst(int maxAmount)
maxAmount
- the number of elements to return.
public abstract List<E> getLast(int maxAmount)
maxAmount
- the number of elements to return.
public abstract E get(int index)
index
- Index of the element to be returned
public abstract List<E> get(int fromIndex, int maxAmount)
fromIndex
- The index of the first element to be returned.maxAmount
- The maximum number of elements to return.
public String getUID(int index)
index
- The index of the UID to be returned.
public abstract int indexOf(String uid)
uid
- The UID of the element to search for
NullPointerException
- if there is no result in the result set that matches the UID.public int indexOf(E element)
element
- The element to search for
public Iterator<E> iterator()
iterator
in interface Iterable<E extends Result>
iterator
in interface Collection<E extends Result>
iterator
in class AbstractCollection<E extends Result>
public List<E> applyRSMDirectives(org.dom4j.Element rsmElement)
rsmElement
- The XML element that contains the 'result set management'
directives.
public org.dom4j.Element generateSetElementFromResults(List<E> returnedResults)
applyRSMDirectives(Element)
as an argument
to this method.
returnedResults
- The subset of Results that is returned by the current query.
public static boolean isValidRSMRequest(org.dom4j.Element rsmElement)
rsmElement
- The Element to check.
|
Openfire 3.6.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |