org.jickr
Class Tag

java.lang.Object
  extended by org.jickr.Tag

public class Tag
extends java.lang.Object

Encapsulates the information about a Tag associated with a Photo.

See Also:
Photo.getTags()

Method Summary
 boolean equals(java.lang.Object o)
          Check if this Tag is equal to the object supplied.
 User getAuthor()
          Gets the Author of this tag.
 java.lang.String getID()
          Gets the unique ID of this tag.
 Photo getParentPhoto()
          Get the Photo that this Tag is attached to.
 java.lang.String getRawText()
          Gets the text of this tag as the user entered it.
static java.util.List<java.lang.String> getRelated(java.lang.String search)
          Get a list of all tags related to the tag supplied, as determined by Flickr.
 java.lang.String getText()
          Gets the text of this tag as used by Flickr.
 int hashCode()
          Return the HashCode of this Tag, based on ID.
 void remove()
          Deletes the Tag.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRelated

public static java.util.List<java.lang.String> getRelated(java.lang.String search)
                                                   throws FlickrException

Get a list of all tags related to the tag supplied, as determined by Flickr.

For instance, a lookup of all tags related to "cat" will return such things as "pet" and "kitty".

Parameters:
search - String of the tag to search.
Returns:
A list of String representation of tags, related to the search term by Flickr.
Throws:
FlickrException - on any error.

getID

public java.lang.String getID()
Gets the unique ID of this tag.

Returns:
The unique ID of this tag.

getAuthor

public User getAuthor()
Gets the Author of this tag.

Returns:
The User which is the author of this tag.

getRawText

public java.lang.String getRawText()
Gets the text of this tag as the user entered it. Typically, you would instead use the value returned by Tag.getText() instead.

Returns:
The raw text of this tag.
See Also:
getText()

getText

public java.lang.String getText()
Gets the text of this tag as used by Flickr. This means it will be sanitized, with spaces and other marks removed. The exact mapping is not publicly defined by Flickr.

Returns:
The text of this tag.

getParentPhoto

public Photo getParentPhoto()
Get the Photo that this Tag is attached to.

Returns:
The Photo that has this tag.

remove

public void remove()
            throws FlickrException
Deletes the Tag. The Tag will no longer be a valid object, and should be discarded.

Throws:
FlickrException - in the event of any error.

equals

public boolean equals(java.lang.Object o)
Check if this Tag is equal to the object supplied. Uses id for comparison.

Overrides:
equals in class java.lang.Object
Parameters:
o - Object to compare.
Returns:
If the object to equal to this object.

hashCode

public int hashCode()
Return the HashCode of this Tag, based on ID.

Overrides:
hashCode in class java.lang.Object
Returns:
int value representing a fairly unique hashcode.