/* (non-Javadoc) * @see org.unitarou.sgf.type.TypedString#getString() */ public String getString() { StringBuilder sb = new StringBuilder(); sb.append(point_.getString()); sb.append(Sgfs.COMPOSE_SEPARATOR); sb.append(label_.getString()); return sb.toString(); }
/* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if ((obj == null) || (!(obj instanceof Label))) { return false; } else if (this == obj) { return true; } else { Label o = (Label) obj; return point_.equals(o.point_); } }
/** * @param size * @param value * @return NOT NULL * @throws TypeParseException valueがパースできなかった場合 * @throws org.unitarou.lang.NullArgumentException 引数がnullの場合 */ public static Label parse(SgfSize size, String value) throws TypeParseException { ArgumentChecker.throwIfNull(size, value); String[] parsed = parseString(value); return new Label(SgfPoint.parseMove(size, parsed[0]), SimpleText.parse(parsed[1])); }
/* (non-Javadoc) * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return point_.hashCode(); }
/* (non-Javadoc) * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(Label obj) { return point_.compareTo(obj.point_); // 同じ場所の場合は上書きを前提 }