- 更新日時:
- 2010/05/11 20:15:55 (2 年 前)
- パス:
- trunk/src/org/rayflood/mikuvat/io/vsq
- ファイル:
-
- 1 追加
- 1 移動
-
. (追加)
-
CommonSection.java (移動) (移動元: trunk/src/org/rayflood/mikuvat/io/CommonSection.java) (6 diff)
凡例:
- 変更なし
- 追加
- 削除
-
trunk/src/org/rayflood/mikuvat/io/vsq/CommonSection.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.splitEqual;1 package org.rayflood.mikuvat.io.vsq; 2 3 import static org.rayflood.mikuvat.Utilities.SPLITCOMMA; 4 import static org.rayflood.mikuvat.Utilities.splitEqual; 5 5 6 6 import java.awt.Color; 7 7 import java.io.File; 8 import java.io.FileNotFoundException; 9 import java.io.IOException; 8 10 import java.util.ArrayList; 9 11 import java.util.List; 10 12 11 public class CommonSection extends ImmutableObject{ 13 import org.rayflood.mikuvat.io.BaseObject; 14 import org.rayflood.mikuvat.io.InvalidBaseObjectException; 15 16 public class CommonSection extends BaseObject{ 12 17 private static final long serialVersionUID = 8435457526013952633L; 13 18 public static final String VERSION = "Version"; … … 77 82 } 78 83 79 StringBu ffer sb = new StringBuffer();84 StringBuilder sb = new StringBuilder(); 80 85 sb.append("CommonSection={"); 81 86 if(!sl.isEmpty()){ … … 89 94 } 90 95 91 public boolean isReadied(){96 public boolean validate() throws InvalidBaseObjectException{ 92 97 boolean ready = true; 93 98 ready &= hasVersion(); … … 96 101 ready &= hasDynamicsMode(); 97 102 ready &= hasPlayMode(); 103 if(!ready){ 104 throw new InvalidBaseObjectException(this); 105 } 98 106 return ready; 99 107 } 100 108 101 public int compareTo( ImmutableObject obj){109 public int compareTo(BaseObject obj){ 102 110 CommonSection commonSection = (CommonSection)obj; 103 111 int c = compare(getName(), commonSection.getName()); … … 108 116 } 109 117 110 public CommonSection over( Object obj, boolean fill, boolean has){118 public CommonSection over(BaseObject obj, boolean fill, boolean has){ 111 119 CommonSection commonSection = ((CommonSection)obj).clone(); 112 120 if(commonSection.hasVersion() && (fill || has == hasVersion())){ … … 276 284 } 277 285 278 public static CommonSection load(String file) throws Exception{279 return (CommonSection) ImmutableObject.load(file);280 } 281 282 public static CommonSection load(File file) throws Exception{283 return (CommonSection) ImmutableObject.load(file);284 } 285 286 public void store(String file) throws Exception{286 public static CommonSection load(String file) throws FileNotFoundException, IOException, ClassNotFoundException{ 287 return (CommonSection)BaseObject.load(file); 288 } 289 290 public static CommonSection load(File file) throws FileNotFoundException, IOException, ClassNotFoundException{ 291 return (CommonSection)BaseObject.load(file); 292 } 293 294 public void store(String file) throws FileNotFoundException, IOException{ 287 295 super.store(file); 288 296 } 289 297 290 public void store(File file) throws Exception{298 public void store(File file) throws FileNotFoundException, IOException{ 291 299 super.store(file); 292 300 } 293 301 294 public static CommonSection unzip(String file) throws Exception{295 return (CommonSection) ImmutableObject.unzip(file);296 } 297 298 public static CommonSection unzip(File file) throws Exception{299 return (CommonSection) ImmutableObject.unzip(file);300 } 301 302 public void zip(String file) throws Exception{302 public static CommonSection unzip(String file) throws IOException, ClassNotFoundException{ 303 return (CommonSection)BaseObject.unzip(file); 304 } 305 306 public static CommonSection unzip(File file) throws IOException, ClassNotFoundException{ 307 return (CommonSection)BaseObject.unzip(file); 308 } 309 310 public void zip(String file) throws IOException{ 303 311 super.zip(file); 304 312 } 305 313 306 public void zip(File file) throws Exception{314 public void zip(File file) throws IOException{ 307 315 super.zip(file); 308 316 }
