コード例 #1
0
ファイル: Tone.java プロジェクト: Abraham-Lin/Medley
  /**
   * 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
ファイル: Note.java プロジェクト: Impro-Visor/Impro-Visor
 /**
  * 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();
 }