示例#1
0
 /* (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();
 }
示例#2
0
  /* (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_);
    }
  }
示例#3
0
  /**
   * @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]));
  }
示例#4
0
 /* (non-Javadoc)
  * @see java.lang.Object#hashCode()
  */
 @Override
 public int hashCode() {
   return point_.hashCode();
 }
示例#5
0
 /* (non-Javadoc)
  * @see java.lang.Comparable#compareTo(java.lang.Object)
  */
 public int compareTo(Label obj) {
   return point_.compareTo(obj.point_); // 同じ場所の場合は上書きを前提
 }