Completely changed the structure and switched to Eclipse Plugin.
[Mograsim.git] / net.mograsim.plugin.core / src / net / mograsim / plugin / asm / model / AsmOperands.java
diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperands.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperands.java
new file mode 100644 (file)
index 0000000..8e5b475
--- /dev/null
@@ -0,0 +1,43 @@
+package net.mograsim.plugin.asm.model;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+public final class AsmOperands
+{
+       private final List<AsmOperand> operands;
+
+       public AsmOperands(List<AsmOperand> operands)
+       {
+               this.operands = Objects.requireNonNull(operands);
+       }
+
+       public List<AsmOperand> getOperands()
+       {
+               return operands;
+       }
+
+       @Override
+       public int hashCode()
+       {
+               return operands.hashCode();
+       }
+
+       @Override
+       public boolean equals(Object obj)
+       {
+               if (this == obj)
+                       return true;
+               if (!(obj instanceof AsmOperands))
+                       return false;
+               AsmOperands other = (AsmOperands) obj;
+               return operands.equals(other.operands);
+       }
+
+       @Override
+       public String toString()
+       {
+               return operands.stream().map(AsmOperand::toString).collect(Collectors.joining(", "));
+       }
+}