org.overlord.sramp.client.query
Class QueryResultSet

java.lang.Object
  extended by org.overlord.sramp.client.query.QueryResultSet
All Implemented Interfaces:
Iterable<ArtifactSummary>

public class QueryResultSet
extends Object
implements Iterable<ArtifactSummary>

An instance of this class is returned by the Atom API client when consumers call the query methods.

Author:
eric.wittmann@redhat.com

Constructor Summary
QueryResultSet(org.jboss.resteasy.plugins.providers.atom.Feed feed)
          Constructor.
 
Method Summary
 ArtifactSummary get(int index)
          Gets an item at the given index.
 int getItemsPerPage()
          Returns the number of items per page in the result set, even if the total number of items returned is less.
 int getStartIndex()
          Returns the starting index for the result set.
 long getTotalResults()
          Returns the total results matched by the query.
 Iterator<ArtifactSummary> iterator()
           
 long size()
          Returns the number of artifacts that matched the query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResultSet

public QueryResultSet(org.jboss.resteasy.plugins.providers.atom.Feed feed)
Constructor.

Parameters:
feed -
Method Detail

size

public long size()
Returns the number of artifacts that matched the query.


getTotalResults

public long getTotalResults()
Returns the total results matched by the query. Returns -1 if this feature is not supported by the server.


getItemsPerPage

public int getItemsPerPage()
Returns the number of items per page in the result set, even if the total number of items returned is less. This represents the number of results *requested*, not returned. So if the result set represents the final page, then the total number of items in the collection might be less than this number. This represents the maximum number that could be contained in the collection, however. Returns -1 if this feature is not supported by the server.


getStartIndex

public int getStartIndex()
Returns the starting index for the result set. This is the index within the overall result set of the first item in the collection. Returns -1 if this feature is not supported by the server.


get

public ArtifactSummary get(int index)
Gets an item at the given index.

Parameters:
index -

iterator

public Iterator<ArtifactSummary> iterator()
Specified by:
iterator in interface Iterable<ArtifactSummary>
See Also:
Iterable.iterator()


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.