@Test public void testSerialization() throws IOException, ClassNotFoundException { KeyedObjects ko1 = new KeyedObjects(); ko1.addObject("Key 1", "Object 1"); ko1.addObject("Key 2", null); ko1.addObject("Key 3", "Object 2"); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(ko1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); KeyedObjects ko2 = (KeyedObjects) in.readObject(); in.close(); assertEquals(ko1, ko2); }
public void addObject(Comparable key, Object object) { setObject(key, object); }
KeyedObjects implements Cloneable, PublicCloneable, Serializable { public void addObject(Comparable key, Object object) { setObject(key, object); } }
KeyedObjects implements Cloneable, PublicCloneable, Serializable { public void addObject(Comparable key, Object object) { setObject(key, object); } KeyedObjects(); }
KeyedObjects implements Cloneable, PublicCloneable, Serializable { public void addObject(Comparable key, Object object) { setObject(key, object); } KeyedObjects(); int getItemCount(); Object getObject(int item); Comparable getKey(int index); int getIndex(Comparable key); List<Comparable> getKeys(); Object getObject(Comparable key); void addObject(Comparable key, Object object); void setObject(Comparable key, Object object); void insertValue(int position, Comparable key, Object value); void removeValue(int index); void removeValue(Comparable key); void clear(); @Override Object clone(); @Override boolean equals(Object obj); @Override int hashCode(); }
KeyedObjects implements Cloneable, PublicCloneable, Serializable { public void addObject(Comparable key, Object object) { setObject(key, object); } KeyedObjects(); int getItemCount(); Object getObject(int item); Comparable getKey(int index); int getIndex(Comparable key); List<Comparable> getKeys(); Object getObject(Comparable key); void addObject(Comparable key, Object object); void setObject(Comparable key, Object object); void insertValue(int position, Comparable key, Object value); void removeValue(int index); void removeValue(Comparable key); void clear(); @Override Object clone(); @Override boolean equals(Object obj); @Override int hashCode();  }