- 更新日時:
- 2010/05/11 20:15:55 (2 年 前)
- パス:
- trunk/src/org/rayflood/mikuvat/io/vsq
- ファイル:
-
- 1 追加
- 1 移動
-
. (追加)
-
TimeLine.java (移動) (移動元: trunk/src/org/rayflood/mikuvat/io/TimeLine.java) (6 diff)
凡例:
- 変更なし
- 追加
- 削除
-
trunk/src/org/rayflood/mikuvat/io/vsq/TimeLine.java
r2 r4 1 package org.rayflood.mikuvat.io ;2 3 import static org.rayflood.mikuvat. io.VSQDecoder.setSectionBracket;4 import static org.rayflood.mikuvat. io.VSQDecoder.splitEqual;1 package org.rayflood.mikuvat.io.vsq; 2 3 import static org.rayflood.mikuvat.Utilities.setSectionBracket; 4 import static org.rayflood.mikuvat.Utilities.splitEqual; 5 5 6 6 import java.io.File; 7 import java.io.FileNotFoundException; 8 import java.io.IOException; 7 9 import java.util.ArrayList; 8 10 import java.util.List; … … 10 12 import java.util.TreeMap; 11 13 12 public class TimeLine extends ImmutableObject{ 14 import org.rayflood.mikuvat.io.BaseObject; 15 import org.rayflood.mikuvat.io.InvalidBaseObjectException; 16 17 public class TimeLine extends BaseObject{ 13 18 private static final long serialVersionUID = -3486238291169847310L; 14 19 public static final String PITCHBEND = "PitchBendBPList"; … … 580 585 } 581 586 if(hasEventTimes()){ 582 StringBu ffer sb = new StringBuffer();587 StringBuilder sb = new StringBuilder(); 583 588 Long ticks[] = getTicks(); 584 589 sb.append(ticks[0] + "={" + getEventBPTime(ticks[0]).toString() + "}"); … … 589 594 } 590 595 591 StringBu ffer sb = new StringBuffer();596 StringBuilder sb = new StringBuilder(); 592 597 sb.append("TimeLine={"); 593 598 if(!sl.isEmpty()){ … … 601 606 } 602 607 603 public boolean isReadied(){608 public boolean validate() throws InvalidBaseObjectException{ 604 609 boolean ready = true; 605 ready &= hasInitialSinger() && getInitialSinger(). isReadied();610 ready &= hasInitialSinger() && getInitialSinger().validate(); 606 611 Long ticks[] = getTicks(); 607 612 for(int i = 0; i < ticks.length; i++){ 608 ready &= getEventBPTime(ticks[i]).isReadied(); 613 ready &= getEventBPTime(ticks[i]).validate(); 614 } 615 if(!ready){ 616 throw new InvalidBaseObjectException(this); 609 617 } 610 618 return ready; 611 619 } 612 620 613 public int compareTo( ImmutableObject obj){621 public int compareTo(BaseObject obj){ 614 622 TimeLine timeLine = (TimeLine)obj; 615 623 return compare(getInitialSinger(), timeLine.getInitialSinger()); 616 624 } 617 625 618 public TimeLine over( Object obj, boolean fill, boolean has){626 public TimeLine over(BaseObject obj, boolean fill, boolean has){ 619 627 TimeLine timeLine = ((TimeLine)obj).clone(); 620 628 if(timeLine.hasInitialSinger()){ … … 872 880 } 873 881 874 public static TimeLine load(String file) throws Exception{875 return (TimeLine) ImmutableObject.load(file);876 } 877 878 public static TimeLine load(File file) throws Exception{879 return (TimeLine) ImmutableObject.load(file);880 } 881 882 public void store(String file) throws Exception{882 public static TimeLine load(String file) throws FileNotFoundException, IOException, ClassNotFoundException{ 883 return (TimeLine)BaseObject.load(file); 884 } 885 886 public static TimeLine load(File file) throws FileNotFoundException, IOException, ClassNotFoundException{ 887 return (TimeLine)BaseObject.load(file); 888 } 889 890 public void store(String file) throws FileNotFoundException, IOException{ 883 891 super.store(file); 884 892 } 885 893 886 public void store(File file) throws Exception{894 public void store(File file) throws FileNotFoundException, IOException{ 887 895 super.store(file); 888 896 } 889 897 890 public static TimeLine unzip(String file) throws Exception{891 return (TimeLine) ImmutableObject.unzip(file);892 } 893 894 public static TimeLine unzip(File file) throws Exception{895 return (TimeLine) ImmutableObject.unzip(file);896 } 897 898 public void zip(String file) throws Exception{898 public static TimeLine unzip(String file) throws IOException, ClassNotFoundException{ 899 return (TimeLine)BaseObject.unzip(file); 900 } 901 902 public static TimeLine unzip(File file) throws IOException, ClassNotFoundException{ 903 return (TimeLine)BaseObject.unzip(file); 904 } 905 906 public void zip(String file) throws IOException{ 899 907 super.zip(file); 900 908 } 901 909 902 public void zip(File file) throws Exception{910 public void zip(File file) throws IOException{ 903 911 super.zip(file); 904 912 }
