Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: joelib/util/types/Int.java


1   ///////////////////////////////////////////////////////////////////////////////
2   //  Filename: $RCSfile: Int.java,v $
3   //  Purpose:  Atom representation.
4   //  Language: Java
5   //  Compiler: JDK 1.4
6   //  Authors:  Joerg K. Wegner
7   //  Version:  $Revision: 1.1 $
8   //            $Date: 2003/10/13 08:17:00 $
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.1 $, $Date: 2003/10/13 08:17:00 $
38   */
39  public class Int 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 i;
51  
52      //~ Constructors ///////////////////////////////////////////////////////////
53  
54      /*-------------------------------------------------------------------------*
55       * constructor
56       *------------------------------------------------------------------------- */
57  
58      /**
59       *  Constructor for the IntInt object
60       */
61      public Int()
62      {
63      }
64  
65      /**
66       *  Constructor for the IntInt object
67       *
68       * @param  _i1  Description of the Parameter
69       */
70      public Int(int _i)
71      {
72          i = _i;
73      }
74  
75      //~ Methods ////////////////////////////////////////////////////////////////
76  
77      public boolean equals(Object otherObj)
78      {
79          if (otherObj instanceof Int)
80          {
81              Int ii = (Int) otherObj;
82  
83              if ((ii.i == this.i))
84              {
85                  return true;
86              }
87              else
88              {
89                  return false;
90              }
91          }
92          else
93          {
94              return false;
95          }
96      }
97  
98      public String toString()
99      {
100         StringBuffer sb = new StringBuffer(10);
101         sb.append('<');
102         sb.append(i);
103         sb.append('>');
104 
105         return sb.toString();
106     }
107 }
108 ///////////////////////////////////////////////////////////////////////////////
109 //  END OF FILE.
110 ///////////////////////////////////////////////////////////////////////////////