Exemplo n.º 1
0
  /**
   * Compares the specified object with this {@code Tone} for equality.
   *
   * @param o object to be compared for equality with this {@code Tone}.
   * @return {@code true} if the specified object is equals to this {@code Tone}.
   */
  public boolean equals(Object o) {
    if (!(o instanceof Tone)) {
      return false;
    }

    if (o == this) {
      return true;
    }

    Tone t = (Tone) o;

    if (t.getPitchClass() == this.pitchClass) {
      return true;
    }

    return false;
  }
Exemplo n.º 2
0
 public Tone(Tone tone) {
   this(tone.getName(), tone.getAccidental(), tone.getPitchClass());
 }