- 更新日時:
- 2010/05/11 20:15:55 (2 年 前)
- パス:
- trunk/src/org/rayflood/mikuvat/io/vsq
- ファイル:
-
- 1 追加
- 1 移動
-
. (追加)
-
IconHandle.java (移動) (移動元: trunk/src/org/rayflood/mikuvat/io/IconHandle.java) (5 diff)
凡例:
- 変更なし
- 追加
- 削除
-
trunk/src/org/rayflood/mikuvat/io/vsq/IconHandle.java
r2 r4 1 package org.rayflood.mikuvat.io ;2 3 import static org.rayflood.mikuvat. io.VSQDecoder.splitEqual;1 package org.rayflood.mikuvat.io.vsq; 2 3 import static org.rayflood.mikuvat.Utilities.splitEqual; 4 4 5 5 import java.io.File; 6 import java.io.FileNotFoundException; 7 import java.io.IOException; 6 8 import java.util.ArrayList; 7 9 import java.util.List; 8 10 9 public class IconHandle extends ImmutableObject{ 11 import org.rayflood.mikuvat.io.BaseObject; 12 import org.rayflood.mikuvat.io.InvalidBaseObjectException; 13 14 public class IconHandle extends BaseObject{ 10 15 private static final long serialVersionUID = 6787028875195143543L; 11 16 public static final String ICONID = "IconID"; … … 93 98 } 94 99 95 StringBu ffer sb = new StringBuffer();100 StringBuilder sb = new StringBuilder(); 96 101 sb.append("IconHandle={"); 97 102 if(!sl.isEmpty()){ … … 105 110 } 106 111 107 public boolean isReadied(){112 public boolean validate() throws InvalidBaseObjectException{ 108 113 boolean ready = true; 109 114 ready &= hasIconID(); … … 114 119 ready &= hasLanguage(); 115 120 ready &= hasProgram(); 121 if(!ready){ 122 throw new InvalidBaseObjectException(this); 123 } 116 124 return ready; 117 125 } 118 126 119 public int compareTo( ImmutableObject obj){127 public int compareTo(BaseObject obj){ 120 128 IconHandle iconHandle = (IconHandle)obj; 121 129 return compare(getIconID(), iconHandle.getIconID()); 122 130 } 123 131 124 public IconHandle over( Object obj, boolean fill, boolean has){132 public IconHandle over(BaseObject obj, boolean fill, boolean has){ 125 133 IconHandle iconHandle = ((IconHandle)obj).clone(); 126 134 if(iconHandle.hasIconID() && (fill || has == hasIconID())){ … … 340 348 } 341 349 342 public static IconHandle load(String file) throws Exception{343 return (IconHandle) ImmutableObject.load(file);344 } 345 346 public static IconHandle load(File file) throws Exception{347 return (IconHandle) ImmutableObject.load(file);348 } 349 350 public void store(String file) throws Exception{350 public static IconHandle load(String file) throws FileNotFoundException, IOException, ClassNotFoundException{ 351 return (IconHandle)BaseObject.load(file); 352 } 353 354 public static IconHandle load(File file) throws FileNotFoundException, IOException, ClassNotFoundException{ 355 return (IconHandle)BaseObject.load(file); 356 } 357 358 public void store(String file) throws FileNotFoundException, IOException{ 351 359 super.store(file); 352 360 } 353 361 354 public void store(File file) throws Exception{362 public void store(File file) throws FileNotFoundException, IOException{ 355 363 super.store(file); 356 364 } 357 365 358 public static IconHandle unzip(String file) throws Exception{359 return (IconHandle) ImmutableObject.unzip(file);360 } 361 362 public static IconHandle unzip(File file) throws Exception{363 return (IconHandle) ImmutableObject.unzip(file);364 } 365 366 public void zip(String file) throws Exception{366 public static IconHandle unzip(String file) throws IOException, ClassNotFoundException{ 367 return (IconHandle)BaseObject.unzip(file); 368 } 369 370 public static IconHandle unzip(File file) throws IOException, ClassNotFoundException{ 371 return (IconHandle)BaseObject.unzip(file); 372 } 373 374 public void zip(String file) throws IOException{ 367 375 super.zip(file); 368 376 } 369 377 370 public void zip(File file) throws Exception{378 public void zip(File file) throws IOException{ 371 379 super.zip(file); 372 380 }
