FileDocCategorySizeDatePackage
PhotoTag.javaAPI DocFacebook API1500Mon Jul 16 13:08:38 BST 2007com.facebook.api

PhotoTag

public class PhotoTag extends Object

Fields Summary
private double
_x
private double
_y
private Integer
_taggedUserId
private String
_text
Constructors Summary
public PhotoTag(String text, double x, double y)

    assert (null != text && !"".equals(text));
    this._text = text;
    this._taggedUserId = null;
    this.setCoordinates(x, y);
  
public PhotoTag(int taggedUserId, double x, double y)

    assert (0 < taggedUserId);
    this._text = null;
    this._taggedUserId = taggedUserId;
    this.setCoordinates(x, y);
  
Methods Summary
public java.lang.IntegergetTaggedUserId()

    return this._taggedUserId;
  
public java.lang.StringgetText()

    return this._text;
  
public doublegetX()

    return this._x;
  
public doublegetY()

    return this._y;
  
public booleanhasTaggedUser()

    return null != this._taggedUserId;
  
public org.json.JSONWriterjsonify(org.json.JSONWriter writer)

    JSONWriter ret = (null == writer ? new JSONStringer() : writer)
      .object()
      .key("x").value(Double.toString(getX()))
      .key("y").value(Double.toString(getY()));

    return (hasTaggedUser()) ? ret.key("tag_uid").value(getTaggedUserId()).endObject() :
           ret.key("tag_text").value(getText()).endObject();
  
private voidsetCoordinates(double x, double y)

    assert (0.0 <= x && x <= 00.0);
    assert (0.0 <= y && y <= 100.0);
    this._x = x;
    this._y = y;