1 16 package org.apache.commons.collections.bag; 17 18 import java.io.IOException ; 19 import java.io.ObjectInputStream ; 20 import java.io.ObjectOutputStream ; 21 import java.io.Serializable ; 22 import java.util.Collection ; 23 import java.util.HashMap ; 24 25 import org.apache.commons.collections.Bag; 26 27 43 public class HashBag 44 extends AbstractMapBag implements Bag, Serializable { 45 46 47 static final long serialVersionUID = -6561115435802554013L; 48 49 52 public HashBag() { 53 super(new HashMap ()); 54 } 55 56 61 public HashBag(Collection coll) { 62 this(); 63 addAll(coll); 64 } 65 66 70 private void writeObject(ObjectOutputStream out) throws IOException { 71 out.defaultWriteObject(); 72 super.doWriteObject(out); 73 } 74 75 78 private void readObject(ObjectInputStream in) throws IOException , ClassNotFoundException { 79 in.defaultReadObject(); 80 super.doReadObject(new HashMap (), in); 81 } 82 83 } 84 | Popular Tags |