01: //** Copyright Statement ***************************************************
02: //The Salmon Open Framework for Internet Applications (SOFIA)
03: // Copyright (C) 1999 - 2002, Salmon LLC
04: //
05: // This program is free software; you can redistribute it and/or
06: // modify it under the terms of the GNU General Public License version 2
07: // as published by the Free Software Foundation;
08: //
09: // This program is distributed in the hope that it will be useful,
10: // but WITHOUT ANY WARRANTY; without even the implied warranty of
11: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: // GNU General Public License for more details.
13: //
14: // You should have received a copy of the GNU General Public License
15: // along with this program; if not, write to the Free Software
16: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: //
18: // For more information please visit http://www.salmonllc.com
19: //** End Copyright Statement ***************************************************
20: package com.salmonllc.util;
21:
22: /////////////////////////
23: //$Archive: /JADE/SourceCode/com/salmonllc/util/TwoObjectContainer.java $
24: //$Author: Dan $
25: //$Revision: 9 $
26: //$Modtime: 10/30/02 2:38p $
27: /////////////////////////
28:
29: /**
30: * This is a simple container object that holds any two other objects.
31: */
32: public class TwoObjectContainer implements java.io.Serializable {
33: Object _object1;
34: Object _object2;
35:
36: /**
37: * Builds an empty TwoObjectContainer
38: */
39: public TwoObjectContainer() {
40: super ();
41: }
42:
43: /**
44: * Builds an TwoObjectContainer and sets the value of object1 and object2
45: */
46:
47: public TwoObjectContainer(Object object1, Object object2) {
48: super ();
49: _object1 = object1;
50: _object2 = object2;
51:
52: }
53:
54: /**
55: * Returns the first object
56: */
57: public Object getObject1() {
58: return _object1;
59: }
60:
61: /**
62: * Returns the second object
63: */
64: public Object getObject2() {
65: return _object2;
66: }
67:
68: /**
69: * Sets the value of the first object.
70: */
71: public void setObject1(Object o) {
72: _object1 = o;
73: }
74:
75: /**
76: * Sets the value of the second object.
77: */
78: public void setObject2(Object o) {
79: _object2 = o;
80: }
81:
82: /**
83: * Creates a String representation of the contents of the TwoObjectContainer
84: * @return - contents of container as a string representation
85: */
86: public String toString() {
87:
88: return super .toString() + "\n obj1:" + getObject1().toString()
89: + "\n obj2:" + getObject2().toString();
90: }
91: }
|