From adcb322b836daaeeb29c03cea1fc4c059030f9a5 Mon Sep 17 00:00:00 2001 From: mdb Date: Tue, 29 May 2001 03:29:54 +0000 Subject: [PATCH] Created a Tuple class for passing around pairs of objects. git-svn-id: https://samskivert.googlecode.com/svn/trunk@132 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/util/Tuple.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 projects/samskivert/src/java/com/samskivert/util/Tuple.java diff --git a/projects/samskivert/src/java/com/samskivert/util/Tuple.java b/projects/samskivert/src/java/com/samskivert/util/Tuple.java new file mode 100644 index 00000000..5a2974f1 --- /dev/null +++ b/projects/samskivert/src/java/com/samskivert/util/Tuple.java @@ -0,0 +1,33 @@ +// +// $Id: Tuple.java,v 1.1 2001/05/29 03:29:54 mdb Exp $ + +package com.samskivert.util; + +/** + * A tuple is a simple object that holds a reference to two other objects. + */ +public class Tuple +{ + /** The left object. */ + public Object left; + + /** The right object. */ + public Object right; + + /** Construct a tuple with the specified two objects. */ + public Tuple (Object left, Object right) + { + this.left = left; + this.right = right; + } + + /** Construct a blank tuple. */ + public Tuple () + { + } + + public String toString () + { + return "[left=" + left + ", right=" + right + "]"; + } +}