OSDN Git Service

9067c9106f960fa3f1e180bde28d27e87af1c2cd
[chemicraft/chemicraft.git] / common / pcc / chemicraft / util / FormulaPart.java
1 package pcc.chemicraft.util;
2
3 public class FormulaPart {
4
5         private String atom;
6         private int amount;
7
8         public FormulaPart(String par1, int par2){
9                 this.atom = par1;
10                 this.amount = par2;
11         }
12
13         public String getAtom(){
14                 return this.atom;
15         }
16
17         public int getAmount(){
18                 return this.amount;
19         }
20
21         @Override
22         public boolean equals(Object par1) {
23                 try {
24                         FormulaPart var1 = (FormulaPart)par1;
25                         if (var1.atom.equals(this.atom) && var1.amount == this.amount) {
26                                 return true;
27                         }
28                 } catch (ClassCastException e) {
29                         return false;
30                 }
31                 return false;
32         }
33
34 }