001: //** Copyright Statement ***************************************************
002: //The Salmon Open Framework for Internet Applications (SOFIA)
003: // Copyright (C) 1999 - 2002, Salmon LLC
004: //
005: // This program is free software; you can redistribute it and/or
006: // modify it under the terms of the GNU General Public License version 2
007: // as published by the Free Software Foundation;
008: //
009: // This program is distributed in the hope that it will be useful,
010: // but WITHOUT ANY WARRANTY; without even the implied warranty of
011: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: // GNU General Public License for more details.
013: //
014: // You should have received a copy of the GNU General Public License
015: // along with this program; if not, write to the Free Software
016: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: //
018: // For more information please visit http://www.salmonllc.com
019: //** End Copyright Statement ***************************************************
020: package com.salmonllc.util;
021:
022: /////////////////////////
023: //$Archive: /JADE/SourceCode/com/salmonllc/util/ThreeObjectContainer.java $
024: //$Author: Dan $
025: //$Revision: 9 $
026: //$Modtime: 10/30/02 2:38p $
027: /////////////////////////
028:
029: /**
030: * This is a simple container object that holds any three other objects.
031: */
032: public class ThreeObjectContainer implements java.io.Serializable {
033: Object _object1;
034: Object _object2;
035: Object _object3;
036:
037: /**
038: * Builds an empty TwoObjectContainer
039: */
040: public ThreeObjectContainer() {
041: super ();
042: }
043:
044: /**
045: * Builds an TwoObjectContainer and sets the value of object1 and object2
046: */
047:
048: public ThreeObjectContainer(Object object1, Object object2,
049: Object object3) {
050: super ();
051: _object1 = object1;
052: _object2 = object2;
053: _object3 = object3;
054:
055: }
056:
057: /**
058: * Returns the first object
059: */
060: public Object getObject1() {
061: return _object1;
062: }
063:
064: /**
065: * Returns the second object
066: */
067: public Object getObject2() {
068: return _object2;
069: }
070:
071: /**
072: * Returns the third object
073: */
074: public Object getObject3() {
075: return _object3;
076: }
077:
078: /**
079: * Sets the value of the first object.
080: */
081: public void setObject1(Object o) {
082: _object1 = o;
083: }
084:
085: /**
086: * Sets the value of the second object.
087: */
088: public void setObject2(Object o) {
089: _object2 = o;
090: }
091:
092: /**
093: * Sets the value of the third object.
094: */
095: public void setObject3(Object o) {
096: _object3 = o;
097: }
098:
099: /**
100: * Creates a String representation of the contents of the ThreebjectContainer
101: * @return - contents of container as a string representation
102: */
103: public String toString() {
104:
105: return super .toString() + "\n obj1:" + getObject1().toString()
106: + "\n obj2:" + getObject2().toString() + "\n obj3:"
107: + getObject3().toString();
108: }
109: }
|