View Javadoc

1   /*** Magnitude.java - part of the MirkE (say murky) application for colormetric analysis emphesizing 
2   kinetics.
3   
4   Created by: jafaleon on 10.01.05
5   
6   
7   MirkE is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11  
12  MirkE is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  GNU General Public License for more details.
16  
17  You should have received a copy of the GNU General Public License
18  along with MirkE; if not, write to the Free Software
19  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
20  */
21  
22  package edu.asu.cri.MirkE.dataStructures;
23  
24  /***
25   * @author jafaleon
26   * 
27   * @class Magnitude to store the different magnitude names.
28   */
29  public class Magnitude {
30  
31      private long id;
32      
33      private String name;
34      /***
35       * Constructor for JavaBeans
36       */
37      public Magnitude() {
38      }
39      
40      /***
41       * Constructor that sets up the magnitude's name.
42       * @param name
43       */
44      public Magnitude(String name) {
45          this.name = name;
46      }
47      
48      /***
49       * @return Returns the id.
50       */
51      public long getId() {
52          return id;
53      }
54      /***
55       * @param id The id to set.
56       */
57      protected void setId(long id) {
58          this.id = id;
59      }
60      /***
61       * @return Returns the name.
62       */
63      public String getName() {
64          return name;
65      }
66      
67      /***
68       * @param name The name to set.
69       */
70      protected void setName(String name) {
71          this.name = name;
72      }
73      
74      /***
75       * @see java.lang.Object#equals(java.lang.Object)
76       */
77      public boolean equals(Object object) {
78          if (object.getClass().getName().equals(this.getClass().getName())) {
79              Magnitude magnitude = (Magnitude)object;
80              
81              if (this.name.equals(magnitude.getName())) {
82                  return true;
83              }
84          }
85          
86          return false;
87      }
88  }