Source code: joelib/util/types/IntInt.java
1 ///////////////////////////////////////////////////////////////////////////////
2 // Filename: $RCSfile: IntInt.java,v $
3 // Purpose: Atom representation.
4 // Language: Java
5 // Compiler: JDK 1.4
6 // Authors: Joerg K. Wegner
7 // Version: $Revision: 1.8 $
8 // $Date: 2003/08/22 15:56:22 $
9 // $Author: wegner $
10 //
11 // Copyright (c) Dept. Computer Architecture, University of Tuebingen, Germany
12 //
13 // This program is free software; you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation version 2 of the License.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 ///////////////////////////////////////////////////////////////////////////////
22 package joelib.util.types;
23
24
25 /*==========================================================================*
26 * IMPORTS
27 *========================================================================== */
28 /*==========================================================================*
29 * CLASS DECLARATION
30 *========================================================================== */
31
32 /**
33 * Two integer values.
34 *
35 * @author wegnerj
36 * @license GPL
37 * @cvsversion $Revision: 1.8 $, $Date: 2003/08/22 15:56:22 $
38 */
39 public class IntInt implements java.io.Serializable
40 {
41 //~ Instance fields ////////////////////////////////////////////////////////
42
43 /*-------------------------------------------------------------------------*
44 * public member variables
45 *------------------------------------------------------------------------- */
46
47 /**
48 * Description of the Field
49 */
50 public int i1;
51
52 /**
53 * Description of the Field
54 */
55 public int i2;
56
57 //~ Constructors ///////////////////////////////////////////////////////////
58
59 /*-------------------------------------------------------------------------*
60 * constructor
61 *------------------------------------------------------------------------- */
62
63 /**
64 * Constructor for the IntInt object
65 */
66 public IntInt()
67 {
68 }
69
70 /**
71 * Constructor for the IntInt object
72 *
73 * @param _i1 Description of the Parameter
74 * @param _i2 Description of the Parameter
75 */
76 public IntInt(int _i1, int _i2)
77 {
78 i1 = _i1;
79 i2 = _i2;
80 }
81
82 //~ Methods ////////////////////////////////////////////////////////////////
83
84 public boolean equals(Object otherObj)
85 {
86 if (otherObj instanceof IntInt)
87 {
88 IntInt ii = (IntInt) otherObj;
89
90 if ((ii.i1 == this.i1) && (ii.i2 == this.i2))
91 {
92 return true;
93 }
94 else
95 {
96 return false;
97 }
98 }
99 else
100 {
101 return false;
102 }
103 }
104
105 public String toString()
106 {
107 StringBuffer sb = new StringBuffer(10);
108 sb.append('<');
109 sb.append(i1);
110 sb.append(',');
111 sb.append(i2);
112 sb.append('>');
113
114 return sb.toString();
115 }
116 }
117 ///////////////////////////////////////////////////////////////////////////////
118 // END OF FILE.
119 ///////////////////////////////////////////////////////////////////////////////