OSDN Git Service

いろいろした
[chemicraft/chemicraft.git] / common / pcc / chemicraft / util / FormulaPart.java
1 package pcc.chemicraft.util;
2
3 /**
4  * 元素情報を格納するクラスです
5  * @author mozipi
6  */
7 public class FormulaPart {
8
9         private String atom;
10         private int amount;
11
12         public FormulaPart(String par1, int par2){
13                 this.atom = par1;
14                 this.amount = par2;
15         }
16
17         public String getAtom(){
18                 return this.atom;
19         }
20
21         public int getAmount(){
22                 return this.amount;
23         }
24
25         @Override
26         public boolean equals(Object par1) {
27                 try {
28                         FormulaPart var1 = (FormulaPart)par1;
29                         if (var1.atom.equals(this.atom) && var1.amount == this.amount) {
30                                 return true;
31                         }
32                 } catch (ClassCastException e) {
33                         return false;
34                 }
35                 return false;
36         }
37
38 }