From 18e8371dac995101e27fefc0a3e10db6f44d0a5c Mon Sep 17 00:00:00 2001 From: mdb Date: Tue, 8 Apr 2008 17:30:35 +0000 Subject: [PATCH] Static methods can do type magic and save us from repeating ourselves. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2293 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/Tuple.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/java/com/samskivert/util/Tuple.java b/src/java/com/samskivert/util/Tuple.java index abdd2626..04372356 100644 --- a/src/java/com/samskivert/util/Tuple.java +++ b/src/java/com/samskivert/util/Tuple.java @@ -35,6 +35,14 @@ public class Tuple implements Serializable /** The right object. */ public R right; + /** + * Creates a tuple with the specified two objects. + */ + public static Tuple create (L left, R right) + { + return new Tuple(left, right); + } + /** Construct a tuple with the specified two objects. */ public Tuple (L left, R right) {