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
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.
0.5.0
Kelvin Luck < kelvin at kelvinluck dot com >
$Id: Tag.as 80 2006-09-06 17:53:53Z kluck $
| com. kelvinluck. flashr. core.Tag | Class to describe a tag on a photo on flickr.com |
| raw | The raw text of this tag |
| value | The text of this tag |
| _photos | An object detailing the relationships between this tag and different photos. |
| relatedTags | An object containing a list of tags that are related to this one, based on clustered usage analysis. |
| _tags | A private static Object containing Tag objects. |
| Tag | Constructor function - creates a new Tag object. |
| _addPhoto | Private internal function - add’s a reference to a Photo to this Tag. |
| getPhotos | Get’s this tags _photos Object. |
| _onTagsGetRelated | Private internal function - used to keep track of whether Flashr.tagsGetRelated has been called for this tag. |
| _addRelatedTag | Private internal function - add’s a reference to a related Tag to this Tag. |
| getRelatedTags | Returns an Array of all the Tags related to this one. |
| getRelatedTagStrings | Gets an Array of the String representation of all Tags related to this one. |
| getTag | Get’s a Tag object for the given id. |
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. Used by getTag to insure that only one Tag is created for each tag returned from flickr.com
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
private function _addPhoto( id: String, photo: Photo, author: Person ):Void
Private internal function - add’s a reference to a Photo to this Tag.
| id | The id which describes the link between this Photo and Tag. |
| photo | The Photo you want to add to this tag. |
| author | The Person who attached that Tag to this Photo. |
private function _onTagsGetRelated()
Private internal function - used to keep track of whether Flashr.tagsGetRelated has been called for this tag.
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. Will log an error return an empty an empty array if Flashr.tagsGetRelated hasn’t been called.
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. Will log an error return an empty an empty array if Flashr.tagsGetRelated hasn’t been called.
An Array of Strings, one for each related tag.
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
| raw | The raw of the Tag you want to get |
The raw text of this tag
public var raw: String
The text of this tag
private var _value: String
An object detailing the relationships between this tag and different photos.
private var _photos: Object
An object containing a list of tags that are related to this one, based on clustered usage analysis.
public var relatedTags: Object
A private static Object containing Tag objects.
private static var _tags: Object
Constructor function - creates a new Tag object.
private function Tag( raw: String )
Private internal function - add’s a reference to a Photo to this Tag.
private function _addPhoto( id: String, photo: Photo, author: Person ):Void
Get’s this tags _photos Object.
function getPhotos():Object
Private internal function - used to keep track of whether Flashr.tagsGetRelated has been called for this tag.
private function _onTagsGetRelated()
Calls flickr.tags.getRelated to get a list of tags ‘related’ to the given tag, based on clustered usage analysis.
public function tagsGetRelated( tag: String ):FlashrRequest
Private internal function - add’s a reference to a related Tag to this Tag.
private function _addRelatedTag( tag: Tag )
Returns an Array of all the Tags related to this one.
function getRelatedTags():Array
Gets an Array of the String representation of all Tags related to this one.
function getRelatedTagStrings()
Get’s a Tag object for the given id.
public static function getTag( raw: String ):Tag