Class Index | Minimal

Classes


Class jabberwerx.EntitySet (MINIMAL)


Extends jabberwerx.JWModel.

A repository for Entity objects, based on JID and/or node.

This class provides the following events:

Class Summary
Constructor Attributes Constructor Name and Description
 
Create a new EntitySet.
Field Summary
Field Attributes Field Name and Description
<static>  
jabberwerx.EntitySet.EntityAlreadyExistsError

Error when attempting to add an entity already contained by an EntitySet.

<static>  
jabberwerx.EntitySet.suppressBatchedEvents
Should EntitySet events not be fired when running a batch? The default behavior (false) is to add the EntitySet event to the list of events passed through the batchUpdateEnded event AND fire the event normally as well.
Method Summary
Method Attributes Method Name and Description
<static>  
jabberwerx.EntitySet.each(op, entityClass)
Visits each entity in this EntitySet.
<static>  
jabberwerx.EntitySet.endBatch()
Indicates that a batch process is ending.
<static>  
jabberwerx.EntitySet.entity(jid, node)
Fetch method for any known-existing jabberwerx.Entity object.
<static>  
jabberwerx.EntitySet.getAllGroups()

Gets a set of all the groups to which the entities in this entity set belong.

<static>  
jabberwerx.EntitySet.register(entity)
Registers the given entity to this EntitySet.
<static>  
jabberwerx.EntitySet.startBatch()
Indicates that a batch process is starting.
<static>  
jabberwerx.EntitySet.toArray()
Returns an array of the entities registered on this EntitySet.
<static>  
jabberwerx.EntitySet.unregister(entity)
Unregister the given entity from this EntitySet.
Methods borrowed from class jabberwerx.JWModel:
applyEvent, event, shouldBeSavedWithGraph
Methods borrowed from class jabberwerx.JWBase:
destroy, getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString, wasUnserialized, willBeSerialized
Class Detail
jabberwerx.EntitySet()
Create a new EntitySet.
Field Detail
<static> jabberwerx.EntitySet.EntityAlreadyExistsError

Error when attempting to add an entity already contained by an EntitySet.


<static> jabberwerx.EntitySet.suppressBatchedEvents
Should EntitySet events not be fired when running a batch? The default behavior (false) is to add the EntitySet event to the list of events passed through the batchUpdateEnded event AND fire the event normally as well. This should only be set to true (do not fire events normally) if your application only has batch aware EntitySet listeners.
Method Detail
<static> jabberwerx.EntitySet.each(op, entityClass)
Visits each entity in this EntitySet. The given function is executed as op(entity). For each execution of <op>, the sole argument is the current entity. The given function can return false to cancel the iteration.
Parameters:
{function} op
The function called for each entity
{Object} entityClass Optional, Default: jabberwerx.Entity
The class of entity to filter

<static> {Boolean} jabberwerx.EntitySet.endBatch()
Indicates that a batch process is ending. This method decrements an internal counter of batch processing requests. If this call ends all other batch processing requests, this method triggers a "batchUpdatedEnded" event and passes it an array of {event name, event data} pairs as its data. ClientEntityCache will batch the following events: entityCreated, entityDestroyed, entityAdded, entityRemoved, entityRenamed and entityUpdated.
Returns:
{Boolean} true if a batch is still in progress after this call.

<static> {jabberwerx.Entity} jabberwerx.EntitySet.entity(jid, node)
Fetch method for any known-existing jabberwerx.Entity object. If the object does not already exist, `undefined` is returned.
Parameters:
{jabberwerx.JID|String} jid Optional
The JID of an entity to fetch.
{String} node Optional
The node of an entity to fetch.

<static> {String[]} jabberwerx.EntitySet.getAllGroups()

Gets a set of all the groups to which the entities in this entity set belong. The contents of the group are unique (i.e. no copies of group names within the array).

Returns:
{String[]} A string array of the group names

<static> {Boolean} jabberwerx.EntitySet.register(entity)
Registers the given entity to this EntitySet.
Parameters:
{jabberwerx.Entity} entity
The entity to register.
Throws:
{TypeError}
if {entity} is not a valid Entity.
Returns:
{Boolean} true if this EntitySet's data was changed by this call.

<static> {Boolean} jabberwerx.EntitySet.startBatch()
Indicates that a batch process is starting. This method increments an internal counter of batch processing requests. If there are no other batch processing requests pending, this method triggers a "batchUpdateStarted" event.
Returns:
{Boolean} true if a batch is already in progress prior to this call

<static> {jabberwerx.Entity[]} jabberwerx.EntitySet.toArray()
Returns an array of the entities registered on this EntitySet.
Returns:
{jabberwerx.Entity[]} An array of the entities registered on this EntitySet

<static> {Boolean} jabberwerx.EntitySet.unregister(entity)
Unregister the given entity from this EntitySet.
Parameters:
{jabberwerx.Entity} entity
The entity to unregister.
Returns:
{Boolean} true if the EntitySet's data was changed by this call.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 02 2014 13:23:41 GMT-0600 (MDT)