com. kelvinluck. flashr. core. Group

Class to describe a group from Flickr.

Instances of this class are created to hold groups who have been returned in data from calls to the Flickr API.

Licence

This code and documentation is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0.  http://creativecommons.org/licenses/by-nc-sa/2.0/

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version

0.5.0

Author

Kelvin Luck < kelvin at kelvinluck dot com >

Project Website

http://flashr.kelvinluck.com/

Subversion Id

$Id: Group.as 79 2006-09-06 16:57:39Z kluck $

Summary
com. kelvinluck. flashr. core. GroupClass to describe a group from Flickr.
PRIVACY_PRIVATEConstant for privacy value for private groups.
PRIVACY_INVITE_ONLYConstant for privacy value for invite only groups.
PRIVACY_PUBLICConstant for privacy value for public groups.
nsidThis group’s nsid.
nameThe name of this group.
eighteenPlusWhether this group is visible to members over 18 only.
descriptionThe description of this Group.
membersThe number of members in this Group.
privacyThe privacy setting of this group.
_poolThis Groups photo pool.
numPhotosThe number of Photos in this Groups pool.
_groupsA private static Object containing Group objects.
Group
_addPhotoPrivate internal function - adds a Photo to this Groups _pool.
_removePhotoPrivate internal function - removes a Photo from this Groups _pool.
getPhotosGet’s this Groups _pool
getGroupGet’s a Group object for the given nsid.

PRIVACY_PRIVATE

static var PRIVACY_PRIVATE: Number

Constant for privacy value for private groups.

PRIVACY_INVITE_ONLY

static var PRIVACY_INVITE_ONLY: Number

Constant for privacy value for invite only groups.

PRIVACY_PUBLIC

static var PRIVACY_PUBLIC: Number

Constant for privacy value for public groups.

nsid

public var nsid: String

This group’s nsid.

name

public var name: String

The name of this group.

eighteenPlus

public var eighteenPlus: Boolean

Whether this group is visible to members over 18 only.

description

var description: String

The description of this Group.

members

var members: Number

The number of members in this Group.

privacy

var privacy: Number

The privacy setting of this group.

See Also

PRIVACY_PRIVATE, PRIVACY_INVITE_ONLY, PRIVACY_PUBLIC

_pool

private var _pool: Array

This Groups photo pool.

See Also

getPhotos

numPhotos

var numPhotos: Number

The number of Photos in this Groups pool.

_groups

private static var _groups: Object

A private static Object containing Group objects.  Used by getGroup to insure that only one Group is created for each nsid returned from flickr.com

Group

private function Group(nsid: String)
Constructor functioncreates a new Group object.

Don’t call directly, use getGroup to make sure that there is only one Group instance for each nsid as returned by flickr.com

Parameters

nsidThe nsid of the Group you are creating.

_addPhoto

private function _addPhoto(photo: Photo)

Private internal function - adds a Photo to this Groups _pool.  If you want to do this you are probably looking for Flashr.groupsPoolsAdd

Parameters

photoThe Photo to add.

_removePhoto

private function _removePhoto(photo: Photo)

Private internal function - removes a Photo from this Groups _pool.  If you want to do this you are probably looking for Flashr.groupsPoolsRemove.

Parameters

photoThe Photo to remove.

getPhotos

function getPhotos():Array

Get’s this Groups _pool

Returns

This Groups _pool

getGroup

public static function getGroup(nsid: String):Group

Get’s a Group object for the given nsid.

Consults _groups to make sure that only one Group instance is created for each nsid from flickr.com

Parameters

nsidThe nsid of the Group you want to get.
static var PRIVACY_PRIVATE: Number
Constant for privacy value for private groups.
var privacy: Number
The privacy setting of this group.
static var PRIVACY_INVITE_ONLY: Number
Constant for privacy value for invite only groups.
static var PRIVACY_PUBLIC: Number
Constant for privacy value for public groups.
public var nsid: String
This group’s nsid.
public var name: String
The name of this group.
public var eighteenPlus: Boolean
Whether this group is visible to members over 18 only.
var description: String
The description of this Group.
private function Group(nsid: String)
var members: Number
The number of members in this Group.
private var _pool: Array
This Groups photo pool.
var numPhotos: Number
The number of Photos in this Groups pool.
Class to describe a photo from Flickr.
private static var _groups: Object
A private static Object containing Group objects.
private function _addPhoto(photo: Photo)
Private internal function - adds a Photo to this Groups _pool.
private function _removePhoto(photo: Photo)
Private internal function - removes a Photo from this Groups _pool.
function getPhotos():Array
Get’s this Groups _pool
public static function getGroup(nsid: String):Group
Get’s a Group object for the given nsid.
function groupsPoolsAdd(photoId: String,
groupId: String):FlashrRequest
Add a photo to a group’s pool.
function groupsPoolsRemove(photoId: String,
groupId: String):FlashrRequest
Remove a photo from a group pool.