PhotoTagpublic class PhotoTag extends Object Data structure for representing a photo tag. Required by some API calls. |
Fields Summary |
---|
private double | _x | private double | _y | private Long | _taggedUserId | private String | _text |
Constructors Summary |
---|
public PhotoTag(String text, double x, double y)Constructor.
assert (null != text && !"".equals(text));
this._text = text;
this._taggedUserId = null;
this.setCoordinates(x, y);
| public PhotoTag(long taggedUserId, double x, double y)Constructor.
assert (0 < taggedUserId);
this._text = null;
this._taggedUserId = taggedUserId;
this.setCoordinates(x, y);
|
Methods Summary |
---|
public java.lang.Long | getTaggedUserId()
return this._taggedUserId;
| public java.lang.String | getText()
return this._text;
| public double | getX()
return this._x;
| public double | getY()
return this._y;
| public boolean | hasTaggedUser()Check to see if this PhotoTag is tagging a specific Facebook user
return null != this._taggedUserId;
| public org.json.JSONObject | jsonify()Convert the tag to a JSON representation.
JSONObject ret = new JSONObject();
try {
ret.put("x", this.getX());
ret.put("y", this.getY());
if (hasTaggedUser()) {
ret.put("tag_uid", getTaggedUserId());
} else {
ret.put("tag_text", getText());
}
}
catch (Exception ignored) {}
return ret;
| private void | setCoordinates(double x, double y)Constructor.
assert (0.0 <= x && x <= 00.0);
assert (0.0 <= y && y <= 100.0);
this._x = x;
this._y = y;
|
|