com.threerings.util
Class StreamableHashSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<E>
              extended by com.threerings.util.StreamableHashSet<E>
Type Parameters:
E - the type of element stored in this set.
All Implemented Interfaces:
Streamable, Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>

public class StreamableHashSet<E>
extends HashSet<E>
implements Streamable

A HashSet extension that can be streamed. The values in the set must also be of streamable types.

See Also:
Streamable, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Constructor Summary
StreamableHashSet()
          Constructs an empty hash set with the default number of hash buckets.
StreamableHashSet(int buckets, float loadFactor)
          Constructs an empty hash set with the specified number of hash buckets.
 
Method Summary
static
<E> StreamableHashSet<E>
newSet()
          Creates an empty StreamableHashSet with the default number of hash buckets.
 void readObject(ObjectInputStream in)
          Reads our custom streamable fields.
 void writeObject(ObjectOutputStream out)
          Writes our custom streamable fields.
 
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

StreamableHashSet

public StreamableHashSet(int buckets,
                         float loadFactor)
Constructs an empty hash set with the specified number of hash buckets.


StreamableHashSet

public StreamableHashSet()
Constructs an empty hash set with the default number of hash buckets.

Method Detail

newSet

public static <E> StreamableHashSet<E> newSet()
Creates an empty StreamableHashSet with the default number of hash buckets.


writeObject

public void writeObject(ObjectOutputStream out)
                 throws IOException
Writes our custom streamable fields.

Throws:
IOException

readObject

public void readObject(ObjectInputStream in)
                throws IOException,
                       ClassNotFoundException
Reads our custom streamable fields.

Throws:
IOException
ClassNotFoundException