From 792a5142cd964fb192ce075bcf2debb69ad591d3 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 18 Nov 2008 21:13:45 +0000 Subject: [PATCH] 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 --- src/java/com/threerings/util/StreamableTuple.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/util/StreamableTuple.java b/src/java/com/threerings/util/StreamableTuple.java index f037647e7..e32053332 100644 --- a/src/java/com/threerings/util/StreamableTuple.java +++ b/src/java/com/threerings/util/StreamableTuple.java @@ -37,10 +37,11 @@ public class StreamableTuple extends Tuple implements Streamable { /** - * Constructs a blank tuple. + * Creates a tuple with the specified two objects. */ - public StreamableTuple () + public static StreamableTuple newTuple (L left, R right) { + return new StreamableTuple(left, right); } /** @@ -50,4 +51,12 @@ public class StreamableTuple extends Tuple { super(left, right); } + + /** + * Don't use this constructor! It's only for unstreaming. + */ + public StreamableTuple () + { + super(null, null); + } }