Factory methods for StreamableArrayList and StreamableHashSet
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6125 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -58,7 +58,7 @@ public class CompoundEvent extends DEvent
|
||||
|
||||
_omgr = omgr;
|
||||
_target = target;
|
||||
_events = new StreamableArrayList<DEvent>();
|
||||
_events = StreamableArrayList.newList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,6 +39,14 @@ import com.threerings.io.Streamable;
|
||||
public class StreamableArrayList<E> extends ArrayList<E>
|
||||
implements Streamable
|
||||
{
|
||||
/**
|
||||
* Creates an empty StreamableArrayList.
|
||||
*/
|
||||
public static <E> StreamableArrayList<E> newList ()
|
||||
{
|
||||
return new StreamableArrayList<E>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes our custom streamable fields.
|
||||
*/
|
||||
|
||||
@@ -40,8 +40,15 @@ public class StreamableHashSet<E> extends HashSet<E>
|
||||
implements Streamable
|
||||
{
|
||||
/**
|
||||
* Constructs an empty hash set with the specified number of hash
|
||||
* buckets.
|
||||
* Creates an empty StreamableHashSet with the default number of hash buckets.
|
||||
*/
|
||||
public static <E> StreamableHashSet<E> newSet ()
|
||||
{
|
||||
return new StreamableHashSet<E>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an empty hash set with the specified number of hash buckets.
|
||||
*/
|
||||
public StreamableHashSet (int buckets, float loadFactor)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user