예제 #1
0
파일: Song.java 프로젝트: steff7/Mp3Player
 @Override
 public int hashCode() {
   int result = 0;
   result = 31 * result ^ id;
   result = 31 * result ^ (title == null ? 0 : title.hashCode());
   result = 31 * result ^ duration;
   result = 31 * result ^ playcount;
   result = 31 * result ^ (int) rating;
   result = 31 * result ^ (path == null ? 0 : path.hashCode());
   result = 31 * result ^ year;
   result = 31 * result ^ (artist == null ? 0 : artist.hashCode());
   result = 31 * result ^ (genre == null ? 0 : genre.hashCode());
   result = 31 * result ^ (pathOk ? 1 : 0);
   result = 31 * result ^ (album == null ? 0 : album.hashCode());
   result = 31 * result ^ (lyric == null ? 0 : lyric.hashCode());
   return result;
 }
예제 #2
0
 /// <summary>
 /// インスタンスを文字列に変換します
 /// </summary>
 /// <param name="encode">2バイト文字をエンコードするか否かを指定するフラグ</param>
 /// <returns>インスタンスを変換した文字列</returns>
 public String toString(boolean encode) {
   String result = "";
   result += "[h#" + (new DecimalFormat("0000")).format(index) + "]";
   switch (m_type) {
     case Lyric:
       result += "\nL0=" + L0.toString(encode);
       break;
     case Vibrato:
       int c_depth = depthBP.getCount();
       result += "\nIconID=" + iconID + "\n";
       result += "IDS=" + IDS + "\n";
       result += "Original=" + original + "\n";
       result += "Caption=" + caption + "\n";
       result += "Length=" + length + "\n";
       result += "StartDepth=" + startDepth + "\n";
       result += "DepthBPNum=" + c_depth + "\n";
       if (c_depth > 0) {
         result += "DepthBPX=" + (new DecimalFormat("0.000000")).format(depthBP.getElement(0).x);
         for (int i = 1; i < c_depth; i++) {
           result += "," + (new DecimalFormat("0.000000")).format(depthBP.getElement(i).x);
         }
         result += "\nDepthBPY=" + depthBP.getElement(0).y;
         for (int i = 1; i < c_depth; i++) {
           result += "," + depthBP.getElement(i).y;
         }
         result += "\n";
       }
       int c_rate = rateBP.getCount();
       result += "StartRate=" + startRate + "\n";
       result += "RateBPNum=" + c_rate;
       if (c_rate > 0) {
         result += "\nRateBPX=" + (new DecimalFormat("0.000000")).format(rateBP.getElement(0).x);
         for (int i = 1; i < c_rate; i++) {
           result += "," + (new DecimalFormat("0.000000")).format(rateBP.getElement(i).x);
         }
         result += "\nRateBPY=" + rateBP.getElement(0).y;
         for (int i = 1; i < c_rate; i++) {
           result += "," + rateBP.getElement(i).y;
         }
       }
       break;
     case Singer:
       result += "\nIconID=" + iconID + "\n";
       result += "IDS=" + IDS + "\n";
       result += "Original=" + original + "\n";
       result += "Caption=" + caption + "\n";
       result += "Length=" + length + "\n";
       result += "Language=" + language + "\n";
       result += "Program=" + program;
       break;
     case NoteHeadHandle:
       result += "\nIconID=" + iconID + "\n";
       result += "IDS=" + IDS + "\n";
       result += "Original=" + original + "\n";
       result += "Caption=" + caption + "\n";
       result += "Length=" + length + "\n";
       result += "Duration=" + duration + "\n";
       result += "Depth=" + depth;
       break;
     default:
       break;
   }
   return result;
 }