Fortunately, Narya can magically set final fields behind the scenes, but we

need to first construct an instance with nulls. Also added newTuple(). Opted
not to make newStreamableTuple() as that would make more sense in a Tuples
class, but this method can only be accessed by calling StreamableTuple.newTuple
which seems to me to already tell the whole story.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5556 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-11-18 21:13:45 +00:00
parent d14937991a
commit 792a5142cd
@@ -37,10 +37,11 @@ public class StreamableTuple<L, R> extends Tuple<L, R>
implements Streamable
{
/**
* Constructs a blank tuple.
* Creates a tuple with the specified two objects.
*/
public StreamableTuple ()
public static <L, R> StreamableTuple<L, R> newTuple (L left, R right)
{
return new StreamableTuple<L, R>(left, right);
}
/**
@@ -50,4 +51,12 @@ public class StreamableTuple<L, R> extends Tuple<L, R>
{
super(left, right);
}
/**
* Don't use this constructor! It's only for unstreaming.
*/
public StreamableTuple ()
{
super(null, null);
}
}