差分発生行の前後
無視リスト:
更新日時:
2010/05/11 20:15:55 (2 年 前)
更新者:
h
ログメッセージ:

refs #2 #8 #9 #7 #6
現状のソースをコミット。一部完了。一部未完了。
関連づいてない完了チケットのチェンジセットもまとめて。
パッケージ階層も大幅に変更。

パス:
trunk/src/org/rayflood/mikuvat/io/vsq
ファイル:
1 追加
1 移動

凡例:

変更なし
追加
削除
  • 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; 
     1package org.rayflood.mikuvat.io.vsq; 
     2 
     3import static org.rayflood.mikuvat.Utilities.SPLITCOMMA; 
     4import static org.rayflood.mikuvat.Utilities.adjustMaxMin; 
     5import static org.rayflood.mikuvat.Utilities.getBigDecimalString; 
     6import static org.rayflood.mikuvat.Utilities.getVibratoBPList; 
     7import static org.rayflood.mikuvat.Utilities.getVibratoBPMap; 
     8import static org.rayflood.mikuvat.Utilities.splitEqual; 
    99 
    1010import java.io.File; 
     11import java.io.FileNotFoundException; 
     12import java.io.IOException; 
    1113import java.math.BigDecimal; 
    1214import java.util.ArrayList; 
     
    1416import java.util.TreeMap; 
    1517 
    16 public class VibratoHandle extends ImmutableObject{ 
     18import org.rayflood.mikuvat.io.BaseObject; 
     19import org.rayflood.mikuvat.io.InvalidBaseObjectException; 
     20 
     21public class VibratoHandle extends BaseObject{ 
    1722        private static final long serialVersionUID = 7575294004927556748L; 
    1823        public static final String ICONID = "IconID"; 
     
    208213                        TreeMap<BigDecimal, Integer> bps = getDepthBP(); 
    209214                        BigDecimal xs[] = bps.keySet().toArray(new BigDecimal[0]); 
    210                         StringBuffer xsb = new StringBuffer(); 
    211                         StringBuffer ysb = new StringBuffer(); 
     215                        StringBuilder xsb = new StringBuilder(); 
     216                        StringBuilder ysb = new StringBuilder(); 
    212217                        xsb.append(getBigDecimalString(xs[0])); 
    213218                        ysb.append(bps.get(xs[0])); 
     
    224229                        TreeMap<BigDecimal, Integer> bps = getRateBP(); 
    225230                        BigDecimal xs[] = bps.keySet().toArray(new BigDecimal[0]); 
    226                         StringBuffer xsb = new StringBuffer(); 
    227                         StringBuffer ysb = new StringBuffer(); 
     231                        StringBuilder xsb = new StringBuilder(); 
     232                        StringBuilder ysb = new StringBuilder(); 
    228233                        xsb.append(getBigDecimalString(xs[0])); 
    229234                        ysb.append(bps.get(xs[0])); 
     
    284289                        TreeMap<BigDecimal, Integer> bps = getDepthBP(); 
    285290                        BigDecimal xs[] = bps.keySet().toArray(new BigDecimal[0]); 
    286                         StringBuffer xsb = new StringBuffer(); 
    287                         StringBuffer ysb = new StringBuffer(); 
     291                        StringBuilder xsb = new StringBuilder(); 
     292                        StringBuilder ysb = new StringBuilder(); 
    288293                        xsb.append(getBigDecimalString(xs[0])); 
    289294                        ysb.append(bps.get(xs[0])); 
     
    304309                        TreeMap<BigDecimal, Integer> bps = getRateBP(); 
    305310                        BigDecimal xs[] = bps.keySet().toArray(new BigDecimal[0]); 
    306                         StringBuffer xsb = new StringBuffer(); 
    307                         StringBuffer ysb = new StringBuffer(); 
     311                        StringBuilder xsb = new StringBuilder(); 
     312                        StringBuilder ysb = new StringBuilder(); 
    308313                        xsb.append(getBigDecimalString(xs[0])); 
    309314                        ysb.append(bps.get(xs[0])); 
     
    316321                } 
    317322 
    318                 StringBuffer sb = new StringBuffer(); 
     323                StringBuilder sb = new StringBuilder(); 
    319324                sb.append("VibratoHandle={"); 
    320325                if(!sl.isEmpty()){ 
     
    328333        } 
    329334 
    330         public boolean isReadied(){ 
     335        public boolean validate() throws InvalidBaseObjectException{ 
    331336                boolean ready = true; 
    332337                ready &= hasIconID(); 
     
    342347                ready &= hasRateBPNum(); 
    343348                ready &= (getRateBPNum() == getRateBP().size()); 
     349                if(!ready){ 
     350                        throw new InvalidBaseObjectException(this); 
     351                } 
    344352                return ready; 
    345353        } 
    346354 
    347         public int compareTo(ImmutableObject obj){ 
     355        public int compareTo(BaseObject obj){ 
    348356                VibratoHandle vibratoHandle = (VibratoHandle)obj; 
    349357                int c = compare(getIconID(), vibratoHandle.getIconID()); 
     
    354362        } 
    355363 
    356         public VibratoHandle over(Object obj, boolean fill, boolean has){ 
     364        public VibratoHandle over(BaseObject obj, boolean fill, boolean has){ 
    357365                VibratoHandle vibratoHandle = ((VibratoHandle)obj).clone(); 
    358366                if(vibratoHandle.hasIconID() && (fill || has == hasIconID())){ 
     
    717725        } 
    718726 
    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{ 
    728736                super.store(file); 
    729737        } 
    730738 
    731         public void store(File file) throws Exception{ 
     739        public void store(File file) throws FileNotFoundException, IOException{ 
    732740                super.store(file); 
    733741        } 
    734742 
    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{ 
    744752                super.zip(file); 
    745753        } 
    746754 
    747         public void zip(File file) throws Exception{ 
     755        public void zip(File file) throws IOException{ 
    748756                super.zip(file); 
    749757        }