com.google.gwt.gadgets.client.osapi
Class OsapiCollection<T extends com.google.gwt.core.client.JavaScriptObject>

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.gadgets.client.osapi.OsapiCollection<T>
Type Parameters:
T - Type of objects in the collection.

public class OsapiCollection<T extends com.google.gwt.core.client.JavaScriptObject>
extends com.google.gwt.core.client.JavaScriptObject

A class representing OpenSocial collection.


Constructor Summary
protected OsapiCollection()
          Required by JavaScriptObject policy.
 
Method Summary
 int getItemsPerPage()
          Returns the number of results returned per page in this response.
 com.google.gwt.core.client.JsArray<T> getList()
          Returns a JavaScript array with collection's content.
 int getStartIndex()
          Returns the index of the first result returned in this response, relative to the starting index of all results that would be returned if no startIndex had been requested.
 int getTotalResults()
          Returns the total number of results that would be returned if there were no start index or count specified.
 java.lang.Iterable<T> iterable()
          Returns Iterable for use with for-each loops.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OsapiCollection

protected OsapiCollection()
Required by JavaScriptObject policy.

Method Detail

getItemsPerPage

public final int getItemsPerPage()
Returns the number of results returned per page in this response. In general, this will be equal to the value set in the CollectionRequestBuilder.setCount(int) method, but MAY be less if the Service Provider is unwilling to return as many results per page as requested, or if there are less than the requested number of results left to return when starting at the current start index. This field MUST be present if and only if a value for count is specified in the request.


getList

public final com.google.gwt.core.client.JsArray<T> getList()
Returns a JavaScript array with collection's content.

Returns:
A JavaScript array with collection's content.

getStartIndex

public final int getStartIndex()
Returns the index of the first result returned in this response, relative to the starting index of all results that would be returned if no startIndex had been requested. In general, this will be equal to the value set in the CollectionRequestBuilder.setStartIndex(int) method, or 0 if no specific startIndex was requested.


getTotalResults

public final int getTotalResults()
Returns the total number of results that would be returned if there were no start index or count specified. This value tells the Consumer how many total results to expect, regardless of the current pagination being used, but taking into account the current filtering options in the request.


iterable

public final java.lang.Iterable<T> iterable()
Returns Iterable for use with for-each loops.

Returns:
Iterable for use with for-each loops.