- 更新日時:
- 2010/05/11 20:15:55 (2 年 前)
- パス:
- trunk/src/org/rayflood/mikuvat/io/vsq
- ファイル:
-
- 1 追加
- 1 移動
-
. (追加)
-
AnoteEvent.java (移動) (移動元: trunk/src/org/rayflood/mikuvat/io/AnoteEvent.java) (6 diff)
凡例:
- 変更なし
- 追加
- 削除
-
trunk/src/org/rayflood/mikuvat/io/vsq/AnoteEvent.java
r2 r4 1 package org.rayflood.mikuvat.io ;2 3 import static org.rayflood.mikuvat. io.VSQDecoder.adjustMaxMin;4 import static org.rayflood.mikuvat. io.VSQDecoder.setSectionBracket;1 package org.rayflood.mikuvat.io.vsq; 2 3 import static org.rayflood.mikuvat.Utilities.adjustMaxMin; 4 import static org.rayflood.mikuvat.Utilities.setSectionBracket; 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; 9 11 import java.util.Map; 12 13 import org.rayflood.mikuvat.io.BaseObject; 14 import org.rayflood.mikuvat.io.InvalidBaseObjectException; 10 15 11 16 public class AnoteEvent extends Event{ … … 292 297 } 293 298 294 StringBu ffer sb = new StringBuffer();299 StringBuilder sb = new StringBuilder(); 295 300 sb.append("AnoteEvent={"); 296 301 if(!sl.isEmpty()){ … … 304 309 } 305 310 306 public boolean isReadied(){311 public boolean validate() throws InvalidBaseObjectException{ 307 312 boolean ready = true; 308 313 ready &= hasLength(); … … 314 319 ready &= hasDecay(); 315 320 ready &= hasAccent(); 316 ready &= hasLyricHandle() && getLyricHandle().isReadied(); 317 ready &= !hasVibratoHandle() || getVibratoHandle().isReadied(); 321 ready &= hasLyricHandle() && getLyricHandle().validate(); 322 ready &= !hasVibratoHandle() || getVibratoHandle().validate(); 323 if(!ready){ 324 throw new InvalidBaseObjectException(this); 325 } 318 326 return ready; 319 327 } 320 328 321 public int compareTo( ImmutableObject obj){329 public int compareTo(BaseObject obj){ 322 330 AnoteEvent anoteEvent = (AnoteEvent)obj; 323 331 int c = compare(getLyricHandle(), anoteEvent.getLyricHandle()); … … 331 339 } 332 340 333 public AnoteEvent over( Object obj, boolean fill, boolean has){341 public AnoteEvent over(BaseObject obj, boolean fill, boolean has){ 334 342 AnoteEvent anoteEvent = ((AnoteEvent)obj).clone(); 335 343 if(anoteEvent.hasLength() && (fill || has == hasLength())){ … … 657 665 } 658 666 659 public static AnoteEvent load(String file) throws Exception{660 return (AnoteEvent) ImmutableObject.load(file);661 } 662 663 public static AnoteEvent load(File file) throws Exception{664 return (AnoteEvent) ImmutableObject.load(file);665 } 666 667 public void store(String file) throws Exception{667 public static AnoteEvent load(String file) throws FileNotFoundException, IOException, ClassNotFoundException{ 668 return (AnoteEvent)BaseObject.load(file); 669 } 670 671 public static AnoteEvent load(File file) throws FileNotFoundException, IOException, ClassNotFoundException{ 672 return (AnoteEvent)BaseObject.load(file); 673 } 674 675 public void store(String file) throws FileNotFoundException, IOException{ 668 676 super.store(file); 669 677 } 670 678 671 public void store(File file) throws Exception{679 public void store(File file) throws FileNotFoundException, IOException{ 672 680 super.store(file); 673 681 } 674 682 675 public static AnoteEvent unzip(String file) throws Exception{676 return (AnoteEvent) ImmutableObject.unzip(file);677 } 678 679 public static AnoteEvent unzip(File file) throws Exception{680 return (AnoteEvent) ImmutableObject.unzip(file);681 } 682 683 public void zip(String file) throws Exception{683 public static AnoteEvent unzip(String file) throws IOException, ClassNotFoundException{ 684 return (AnoteEvent)BaseObject.unzip(file); 685 } 686 687 public static AnoteEvent unzip(File file) throws IOException, ClassNotFoundException{ 688 return (AnoteEvent)BaseObject.unzip(file); 689 } 690 691 public void zip(String file) throws IOException{ 684 692 super.zip(file); 685 693 } 686 694 687 public void zip(File file) throws Exception{695 public void zip(File file) throws IOException{ 688 696 super.zip(file); 689 697 }
