- 更新日時:
- 2010/05/11 20:15:55 (2 年 前)
- パス:
- trunk/src/org/rayflood/mikuvat/io/vsq
- ファイル:
-
- 1 追加
- 1 移動
-
. (追加)
-
VibratoHandle.java (移動) (移動元: trunk/src/org/rayflood/mikuvat/io/VibratoHandle.java) (11 diff)
凡例:
- 変更なし
- 追加
- 削除
-
trunk/src/org/rayflood/mikuvat/io/vsq/VibratoHandle.java
r2 r4 1 package org.rayflood.mikuvat.io ;2 3 import static org.rayflood.mikuvat. io.VSQDecoder.SPLITCOMMA;4 import static org.rayflood.mikuvat. io.VSQDecoder.adjustMaxMin;5 import static org.rayflood.mikuvat. io.VSQDecoder.getBigDecimalString;6 import static org.rayflood.mikuvat. io.VSQDecoder.getVibratoBPList;7 import static org.rayflood.mikuvat. io.VSQDecoder.getVibratoBPMap;8 import static org.rayflood.mikuvat. io.VSQDecoder.splitEqual;1 package org.rayflood.mikuvat.io.vsq; 2 3 import static org.rayflood.mikuvat.Utilities.SPLITCOMMA; 4 import static org.rayflood.mikuvat.Utilities.adjustMaxMin; 5 import static org.rayflood.mikuvat.Utilities.getBigDecimalString; 6 import static org.rayflood.mikuvat.Utilities.getVibratoBPList; 7 import static org.rayflood.mikuvat.Utilities.getVibratoBPMap; 8 import static org.rayflood.mikuvat.Utilities.splitEqual; 9 9 10 10 import java.io.File; 11 import java.io.FileNotFoundException; 12 import java.io.IOException; 11 13 import java.math.BigDecimal; 12 14 import java.util.ArrayList; … … 14 16 import java.util.TreeMap; 15 17 16 public class VibratoHandle extends ImmutableObject{ 18 import org.rayflood.mikuvat.io.BaseObject; 19 import org.rayflood.mikuvat.io.InvalidBaseObjectException; 20 21 public class VibratoHandle extends BaseObject{ 17 22 private static final long serialVersionUID = 7575294004927556748L; 18 23 public static final String ICONID = "IconID"; … … 208 213 TreeMap<BigDecimal, Integer> bps = getDepthBP(); 209 214 BigDecimal xs[] = bps.keySet().toArray(new BigDecimal[0]); 210 StringBu ffer xsb = new StringBuffer();211 StringBu ffer ysb = new StringBuffer();215 StringBuilder xsb = new StringBuilder(); 216 StringBuilder ysb = new StringBuilder(); 212 217 xsb.append(getBigDecimalString(xs[0])); 213 218 ysb.append(bps.get(xs[0])); … … 224 229 TreeMap<BigDecimal, Integer> bps = getRateBP(); 225 230 BigDecimal xs[] = bps.keySet().toArray(new BigDecimal[0]); 226 StringBu ffer xsb = new StringBuffer();227 StringBu ffer ysb = new StringBuffer();231 StringBuilder xsb = new StringBuilder(); 232 StringBuilder ysb = new StringBuilder(); 228 233 xsb.append(getBigDecimalString(xs[0])); 229 234 ysb.append(bps.get(xs[0])); … … 284 289 TreeMap<BigDecimal, Integer> bps = getDepthBP(); 285 290 BigDecimal xs[] = bps.keySet().toArray(new BigDecimal[0]); 286 StringBu ffer xsb = new StringBuffer();287 StringBu ffer ysb = new StringBuffer();291 StringBuilder xsb = new StringBuilder(); 292 StringBuilder ysb = new StringBuilder(); 288 293 xsb.append(getBigDecimalString(xs[0])); 289 294 ysb.append(bps.get(xs[0])); … … 304 309 TreeMap<BigDecimal, Integer> bps = getRateBP(); 305 310 BigDecimal xs[] = bps.keySet().toArray(new BigDecimal[0]); 306 StringBu ffer xsb = new StringBuffer();307 StringBu ffer ysb = new StringBuffer();311 StringBuilder xsb = new StringBuilder(); 312 StringBuilder ysb = new StringBuilder(); 308 313 xsb.append(getBigDecimalString(xs[0])); 309 314 ysb.append(bps.get(xs[0])); … … 316 321 } 317 322 318 StringBu ffer sb = new StringBuffer();323 StringBuilder sb = new StringBuilder(); 319 324 sb.append("VibratoHandle={"); 320 325 if(!sl.isEmpty()){ … … 328 333 } 329 334 330 public boolean isReadied(){335 public boolean validate() throws InvalidBaseObjectException{ 331 336 boolean ready = true; 332 337 ready &= hasIconID(); … … 342 347 ready &= hasRateBPNum(); 343 348 ready &= (getRateBPNum() == getRateBP().size()); 349 if(!ready){ 350 throw new InvalidBaseObjectException(this); 351 } 344 352 return ready; 345 353 } 346 354 347 public int compareTo( ImmutableObject obj){355 public int compareTo(BaseObject obj){ 348 356 VibratoHandle vibratoHandle = (VibratoHandle)obj; 349 357 int c = compare(getIconID(), vibratoHandle.getIconID()); … … 354 362 } 355 363 356 public VibratoHandle over( Object obj, boolean fill, boolean has){364 public VibratoHandle over(BaseObject obj, boolean fill, boolean has){ 357 365 VibratoHandle vibratoHandle = ((VibratoHandle)obj).clone(); 358 366 if(vibratoHandle.hasIconID() && (fill || has == hasIconID())){ … … 717 725 } 718 726 719 public static VibratoHandle load(String file) throws Exception{720 return (VibratoHandle) ImmutableObject.load(file);721 } 722 723 public static VibratoHandle load(File file) throws Exception{724 return (VibratoHandle) ImmutableObject.load(file);725 } 726 727 public void store(String file) throws Exception{727 public static VibratoHandle load(String file) throws FileNotFoundException, IOException, ClassNotFoundException{ 728 return (VibratoHandle)BaseObject.load(file); 729 } 730 731 public static VibratoHandle load(File file) throws FileNotFoundException, IOException, ClassNotFoundException{ 732 return (VibratoHandle)BaseObject.load(file); 733 } 734 735 public void store(String file) throws FileNotFoundException, IOException{ 728 736 super.store(file); 729 737 } 730 738 731 public void store(File file) throws Exception{739 public void store(File file) throws FileNotFoundException, IOException{ 732 740 super.store(file); 733 741 } 734 742 735 public static VibratoHandle unzip(String file) throws Exception{736 return (VibratoHandle) ImmutableObject.unzip(file);737 } 738 739 public static VibratoHandle unzip(File file) throws Exception{740 return (VibratoHandle) ImmutableObject.unzip(file);741 } 742 743 public void zip(String file) throws Exception{743 public static VibratoHandle unzip(String file) throws IOException, ClassNotFoundException{ 744 return (VibratoHandle)BaseObject.unzip(file); 745 } 746 747 public static VibratoHandle unzip(File file) throws IOException, ClassNotFoundException{ 748 return (VibratoHandle)BaseObject.unzip(file); 749 } 750 751 public void zip(String file) throws IOException{ 744 752 super.zip(file); 745 753 } 746 754 747 public void zip(File file) throws Exception{755 public void zip(File file) throws IOException{ 748 756 super.zip(file); 749 757 }
