import java.io.*; import java.util.*; import java.awt.*; import utilities.files.*; public class Graph extends Hashtable { //------------------------------------------------------------------- // main() entry point //------------------------------------------------------------------- public static void main (String[] args) { Graph anObject; anObject = new Graph(); anObject.fillTable(); System.out.println("Original object : " + anObject); FileKit.saveObject(anObject, "graph.ser"); anObject = null; // loose original object anObject = (Graph) FileKit.loadObject("graph.ser"); System.out.println("Restored object : " + anObject); } //------------------------------------------------------------------- // fill up the Hashtable with a mixed bag of stuff //------------------------------------------------------------------- protected void fillTable() { Vector hobbies = new Vector(); hobbies.addElement("numismatism"); hobbies.addElement("entomology"); put("length", new Integer(190)); put("weight", new Float(73.5)); put("color", Color.white); put("hobbies", hobbies); put("roomSize", new Dimension(2,2)); } } // End of Class Graph