- 更新日時:
- 2010/05/11 20:15:55 (2 年 前)
- パス:
- trunk/src/org/rayflood/mikuvat/io/vsq
- ファイル:
-
- 1 追加
- 1 移動
-
. (追加)
-
LyricNote.java (移動) (移動元: trunk/src/org/rayflood/mikuvat/io/LyricNote.java) (7 diff)
凡例:
- 変更なし
- 追加
- 削除
-
trunk/src/org/rayflood/mikuvat/io/vsq/LyricNote.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.SPLITDQUOTE;5 import static org.rayflood.mikuvat. io.VSQDecoder.adjustMaxMin;6 import static org.rayflood.mikuvat. io.VSQDecoder.getBigDecimalString;7 import static org.rayflood.mikuvat. io.VSQDecoder.getBooleanValue;8 import static org.rayflood.mikuvat. io.VSQDecoder.getStringValue;1 package org.rayflood.mikuvat.io.vsq; 2 3 import static org.rayflood.mikuvat.Utilities.SPLITCOMMA; 4 import static org.rayflood.mikuvat.Utilities.SPLITDQUOTE; 5 import static org.rayflood.mikuvat.Utilities.adjustMaxMin; 6 import static org.rayflood.mikuvat.Utilities.getBigDecimalString; 7 import static org.rayflood.mikuvat.Utilities.getBooleanValue; 8 import static org.rayflood.mikuvat.Utilities.getStringValue; 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; 13 15 import java.util.List; 14 16 15 public class LyricNote extends ImmutableObject{ 17 import org.rayflood.mikuvat.io.BaseObject; 18 import org.rayflood.mikuvat.io.InvalidBaseObjectException; 19 20 public class LyricNote extends BaseObject{ 16 21 private static final long serialVersionUID = -119405351990339359L; 17 22 public static final BigDecimal A_MAX = new BigDecimal("1.0"); … … 78 83 } 79 84 if(hasB()){ 80 StringBu ffer sb = new StringBuffer();85 StringBuilder sb = new StringBuilder(); 81 86 sb.append(b[0]); 82 87 for(int i = 1; i < b.length; i++){ … … 89 94 } 90 95 91 StringBu ffer sb = new StringBuffer();96 StringBuilder sb = new StringBuilder(); 92 97 sb.append("LyricNote={"); 93 98 if(!sl.isEmpty()){ … … 101 106 } 102 107 103 public boolean isReadied(){108 public boolean validate() throws InvalidBaseObjectException{ 104 109 boolean ready = true; 105 110 ready &= hasCaption(); … … 108 113 ready &= hasB(); 109 114 ready &= hasProtect(); 115 if(!ready){ 116 throw new InvalidBaseObjectException(this); 117 } 110 118 return ready; 111 119 } 112 120 113 public int compareTo( ImmutableObject obj){121 public int compareTo(BaseObject obj){ 114 122 LyricNote lyricNote = (LyricNote)obj; 115 123 int c = compare(getCaption(), lyricNote.getCaption()); … … 123 131 } 124 132 125 public LyricNote over( Object obj, boolean fill, boolean has){133 public LyricNote over(BaseObject obj, boolean fill, boolean has){ 126 134 LyricNote lyricNote = ((LyricNote)obj).clone(); 127 135 if(lyricNote.hasCaption() && (fill || has == hasCaption())){ … … 281 289 } 282 290 283 public static LyricNote load(String file) throws Exception{284 return (LyricNote) ImmutableObject.load(file);285 } 286 287 public static LyricNote load(File file) throws Exception{288 return (LyricNote) ImmutableObject.load(file);289 } 290 291 public void store(String file) throws Exception{291 public static LyricNote load(String file) throws FileNotFoundException, IOException, ClassNotFoundException{ 292 return (LyricNote)BaseObject.load(file); 293 } 294 295 public static LyricNote load(File file) throws FileNotFoundException, IOException, ClassNotFoundException{ 296 return (LyricNote)BaseObject.load(file); 297 } 298 299 public void store(String file) throws FileNotFoundException, IOException{ 292 300 super.store(file); 293 301 } 294 302 295 public void store(File file) throws Exception{303 public void store(File file) throws FileNotFoundException, IOException{ 296 304 super.store(file); 297 305 } 298 306 299 public static LyricNote unzip(String file) throws Exception{300 return (LyricNote) ImmutableObject.unzip(file);301 } 302 303 public static LyricNote unzip(File file) throws Exception{304 return (LyricNote) ImmutableObject.unzip(file);305 } 306 307 public void zip(String file) throws Exception{307 public static LyricNote unzip(String file) throws IOException, ClassNotFoundException{ 308 return (LyricNote)BaseObject.unzip(file); 309 } 310 311 public static LyricNote unzip(File file) throws IOException, ClassNotFoundException{ 312 return (LyricNote)BaseObject.unzip(file); 313 } 314 315 public void zip(String file) throws IOException{ 308 316 super.zip(file); 309 317 } 310 318 311 public void zip(File file) throws Exception{319 public void zip(File file) throws IOException{ 312 320 super.zip(file); 313 321 }
