-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
serialization/deserialization of ICF state, UI fixes, more classes ar…
…e final
- Loading branch information
1 parent
07c3431
commit dad43a2
Showing
16 changed files
with
164 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/main/java/XIS/sections/imagecopyfinder/ComparedImagePair.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/XIS/sections/imagecopyfinder/ParsingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/XIS/sections/imagecopyfinder/SerializableIcfState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package XIS.sections.imagecopyfinder; | ||
|
||
import java.io.*; | ||
import java.util.List; | ||
|
||
public final class SerializableIcfState implements Serializable { | ||
|
||
public static final long serialVersionUID = 1L; | ||
private List<ComparedImagePair> imagePairs; | ||
private String inputCommand; | ||
private int inputImageSize; | ||
private String inputCommandDeleteLocation; | ||
|
||
public SerializableIcfState(List<ComparedImagePair> imagePairs, String inputCommand, int inputImageSize, String inputCommandDeleteLocation) { | ||
this.imagePairs = imagePairs; | ||
this.inputCommand = inputCommand; | ||
this.inputImageSize = inputImageSize; | ||
this.inputCommandDeleteLocation = inputCommandDeleteLocation; | ||
} | ||
|
||
public List<ComparedImagePair> getImagePairs() { | ||
return imagePairs; | ||
} | ||
|
||
public String getInputCommand() { | ||
return inputCommand; | ||
} | ||
|
||
public int getInputImageSize() { | ||
return inputImageSize; | ||
} | ||
|
||
public String getInputCommandDeleteLocation() { | ||
return inputCommandDeleteLocation; | ||
} | ||
|
||
public static boolean serialize(SerializableIcfState serializableIcfState) { | ||
try (ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream("icf.serialized"))) { | ||
outputStream.writeObject(serializableIcfState); | ||
outputStream.close(); | ||
return true; | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
return false; | ||
} | ||
} | ||
|
||
public static SerializableIcfState deserialize() { | ||
try (ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream("icf.serialized"))) { | ||
return (SerializableIcfState) inputStream.readObject(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters