示例#1
0
  /**
   * Returns the hash code value for this {@code Tone}.
   *
   * @return the hash code value for this {@code Tone}.
   */
  public int hashCode() {
    final int prime = 911;

    int hash = 1;
    hash = prime * hash + name.hashCode();
    hash = prime * hash + accidental.hashCode();
    hash = prime * hash + pitchClass;
    hash = prime * hash + accidentalID;

    return hash;
  }
示例#2
0
 public static Accidental getAccidental(int v) {
   // v must be from -2 to 2
   return Accidental.values()[v + 2];
 }
示例#3
0
 /**
  * Writes the Note to the passed BufferedWriter.
  *
  * @param out the BufferedWriter to write the Note to
  */
 public void save(BufferedWriter out) throws IOException {
   out.write(accidental.toString() + ' ' + pitch + ' ' + rhythmValue);
   out.newLine();
 }