00001
00002
00003
00004
00005
00006
00007 package Sct;
00008
00014 public class SerializableWrapper implements Serializable {
00015
00021 public SerializableWrapper(Streamable s) {
00022 this.st = s;
00023 className = "Sct.SerializableWrapper";
00024 uniqueID = className + count++;
00025 }
00026
00030 public SerializableWrapper(Streamable s, String uniqueID, String className) {
00031 this.st = s;
00032 this.uniqueID = uniqueID;
00033 this.className = className;
00034 }
00035
00036 public String getClassName() {
00037 return className;
00038 }
00039
00040 public String getUniqueID() {
00041 return uniqueID;
00042 }
00043
00044 public void write(OStream s, ObjectManager o) throws java.io.IOException {
00045 o.writeObject(s, "Wrapped", this.st, true);
00046 }
00047
00048 public static SerializableWrapper read(IStream in, ObjectManager o) throws java.io.IOException {
00049 return new SerializableWrapper(o.readObject(in, "Wrapped"));
00050 }
00051
00052 public Streamable get(){
00053 return st;
00054 }
00055
00056 Streamable st;
00057 private static int count = 0;
00058 private String className;
00059 private String uniqueID;
00060 };
00061