com. kelvinluck. flashr. core.Tag

Class to describe a tag on a photo on flickr.com

Instances of this class are created to hold tags that are attached to Photos returned from flickr.com

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: Tag.as 80 2006-09-06 17:53:53Z kluck $

Summary
com. kelvinluck. flashr. core.TagClass to describe a tag on a photo on flickr.com
rawThe raw text of this tag
valueThe text of this tag
_photosAn object detailing the relationships between this tag and different photos.
relatedTagsAn object containing a list of tags that are related to this one, based on clustered usage analysis.
_tagsA private static Object containing Tag objects.
TagConstructor function - creates a new Tag object.
_addPhotoPrivate internal function - add’s a reference to a Photo to this Tag.
getPhotosGet’s this tags _photos Object.
_onTagsGetRelatedPrivate internal function - used to keep track of whether Flashr.tagsGetRelated has been called for this tag.
_addRelatedTagPrivate internal function - add’s a reference to a related Tag to this Tag.
getRelatedTagsReturns an Array of all the Tags related to this one.
getRelatedTagStringsGets an Array of the String representation of all Tags related to this one.
getTagGet’s a Tag object for the given id.

raw

public var raw: String

The raw text of this tag

value

private var _value: String

The text of this tag

_photos

private var _photos: Object

An object detailing the relationships between this tag and different photos.

relatedTags

public var relatedTags: Object

An object containing a list of tags that are related to this one, based on clustered usage analysis.

See Also

Flashr.tagsGetRelated

_tags

private static var _tags: Object

A private static Object containing Tag objects.  Used by getTag to insure that only one Tag is created for each tag returned from flickr.com

Tag

private function Tag(raw: String)

Constructor function - creates a new Tag object.

Don’t call directly, use getTag to make sure that there is only one Tag instance for each raw value as returned by flickr.com

_addPhoto

private function _addPhoto(id: String,
photo: Photo,
author: Person):Void

Private internal function - add’s a reference to a Photo to this Tag.

Parameters

idThe id which describes the link between this Photo and Tag.
photoThe Photo you want to add to this tag.
authorThe Person who attached that Tag to this Photo.

See Also

getPhotos, _photos

getPhotos

function getPhotos():Object

Get’s this tags _photos Object.

See Also

_photos

_onTagsGetRelated

private function _onTagsGetRelated()

Private internal function - used to keep track of whether Flashr.tagsGetRelated has been called for this tag.

_addRelatedTag

private function _addRelatedTag(tag: Tag)

Private internal function - add’s a reference to a related Tag to this Tag.

See Also

Flashr.tagsGetRelated

getRelatedTags

function getRelatedTags():Array

Returns an Array of all the Tags related to this one.  Will log an error return an empty an empty array if Flashr.tagsGetRelated hasn’t been called.

Returns

An Array of all the Tags related to this one.

See Also

Flashr.tagsGetRelated

getRelatedTagStrings

function getRelatedTagStrings()

Gets an Array of the String representation of all Tags related to this one.  Will log an error return an empty an empty array if Flashr.tagsGetRelated hasn’t been called.

Returns

An Array of Strings, one for each related tag.

getTag

public static function getTag(raw: String):Tag

Get’s a Tag object for the given id.

Consults _tags to make sure that only one Tag instance is created for each tag id from flickr.com

Parameters

rawThe raw of the Tag you want to get
public var raw: String
The raw text of this tag
private var _value: String
The text of this tag
private var _photos: Object
An object detailing the relationships between this tag and different photos.
public var relatedTags: Object
An object containing a list of tags that are related to this one, based on clustered usage analysis.
private static var _tags: Object
A private static Object containing Tag objects.
private function Tag(raw: String)
Constructor function - creates a new Tag object.
private function _addPhoto(id: String,
photo: Photo,
author: Person):Void
Private internal function - add’s a reference to a Photo to this Tag.
Class to describe a photo from Flickr.
function getPhotos():Object
Get’s this tags _photos Object.
private function _onTagsGetRelated()
Private internal function - used to keep track of whether Flashr.tagsGetRelated has been called for this tag.
public function tagsGetRelated(tag: String):FlashrRequest
Calls flickr.tags.getRelated to get a list of tags ‘related’ to the given tag, based on clustered usage analysis.
private function _addRelatedTag(tag: Tag)
Private internal function - add’s a reference to a related Tag to this Tag.
function getRelatedTags():Array
Returns an Array of all the Tags related to this one.
function getRelatedTagStrings()
Gets an Array of the String representation of all Tags related to this one.
public static function getTag(raw: String):Tag
Get’s a Tag object for the given id.
Class to describe a person from Flickr.