\r
import java.util.Arrays;\r
\r
+import era.mi.logic.types.Bit;\r
+\r
public final class Util\r
{\r
\r
\r
public static Bit[] and(Bit[] a, Bit[] b)\r
{\r
- return binBitOp(a, b, (bA, bB) -> Bit.and(bA, bB));\r
+ return binBitOp(a, b, Bit::and);\r
}\r
\r
public static Bit[] or(Bit[] a, Bit[] b)\r
{\r
- return binBitOp(a, b, (bA, bB) -> Bit.or(bA, bB));\r
+ return binBitOp(a, b, Bit::or);\r
}\r
\r
public static Bit[] xor(Bit[] a, Bit[] b)\r
{\r
- return binBitOp(a, b, (bA, bB) -> Bit.xor(bA, bB));\r
+ return binBitOp(a, b, Bit::xor);\r
}\r
\r
private static Bit[] binBitOp(Bit[] a, Bit[] b, BitOp op)\r
throw new IllegalArgumentException("Bit Arrays were not of equal length.");\r
for (int i = 0; i < addition.length; i++)\r
{\r
- dest[i] = dest[i].combineWith(addition[i]);\r
+ dest[i] = dest[i].join(addition[i]);\r
}\r
return dest;\r
}\r