Machine name is no in mpm files
[Mograsim.git] / plugins / net.mograsim.machine / src / net / mograsim / machine / isa / AsmOperation.java
1 package net.mograsim.machine.isa;
2
3 import java.util.Objects;
4
5 public final class AsmOperation
6 {
7         private final String mnemonic;
8
9         public AsmOperation(String mnemonic)
10         {
11                 this.mnemonic = Objects.requireNonNull(mnemonic.toLowerCase());
12         }
13
14         public String getMnemonic()
15         {
16                 return mnemonic;
17         }
18
19         @Override
20         public String toString()
21         {
22                 return getMnemonic();
23         }
24
25         @Override
26         public int hashCode()
27         {
28                 return mnemonic.hashCode();
29         }
30
31         @Override
32         public boolean equals(Object obj)
33         {
34                 if (this == obj)
35                         return true;
36                 if (!(obj instanceof AsmOperation))
37                         return false;
38                 AsmOperation other = (AsmOperation) obj;
39                 return mnemonic.equals(other.mnemonic);
40         }
41 }