English | Site Directory

opensocial.Collection (v0.7)

 SUMMARY     DETAIL

Class opensocial.Collection

Collection of multiple objects with useful accessors. May also represent subset of a larger collection (for example, page 1 of 10) and contain information about the larger collection.

Method Summary

 Array.<Object> asArray()
Returns an array of all the objects in this collection.
each(fn)
Executes the provided function once per member of the collection, with each member in turn as the parameter to the function.
 Object? getById(id)
Finds the entry with the given ID value, or returns null if none is found.
 Number getOffset()
Gets the offset of this collection within a larger result set.
 Number getTotalSize()
Gets the total size of the larger result set that this collection belongs to.
 Number size()
Gets the size of this collection, which is equal to or less than the total size of the result.
 

Method Detail

asArray

Array.<Object> asArray()
    Returns an array of all the objects in this collection.
    Returns:
      Array.<Object> The values in this collection

each

each(fn)
    Executes the provided function once per member of the collection, with each member in turn as the parameter to the function.
    Parameters:
      Function fn - The function to call with each collection entry

getById

Object? getById(id)
    Finds the entry with the given ID value, or returns null if none is found.
    Parameters:
      String id - The ID to look for
    Returns:
      Object? The data

getOffset

Number getOffset()
    Gets the offset of this collection within a larger result set.
    Returns:
      Number The offset into the total collection

getTotalSize

Number getTotalSize()
    Gets the total size of the larger result set that this collection belongs to.
    Returns:
      Number The total size of the result

size

Number size()
    Gets the size of this collection, which is equal to or less than the total size of the result.
    Returns:
      Number The size of this collection

Documentation generated by JsDoc Toolkit 1.3.3