PhotoTagpublic 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.Integer | 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()
return null != this._taggedUserId;
| public org.json.JSONWriter | jsonify(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 void | setCoordinates(double x, double y)
assert (0.0 <= x && x <= 00.0);
assert (0.0 <= y && y <= 100.0);
this._x = x;
this._y = y;
|
|