+ /**
+ * Set the most significant bit at <code>bitIndex</code>. (leftmost bit of a binary number at the given index)
+ */
+ public void setMSBit(int bitIndex, Bit bit)
+ {
+ if (bits == null)
+ throw new IllegalStateException("cannot set a bit of an empty mutator");
+ bits[bitIndex] = bit;
+ }
+
+ /**
+ * Set the least significant bit at <code>bitIndex</code>. (rightmost bit of a binary number at the given index)
+ */
+ public void setLSBit(int bitIndex, Bit bit)
+ {
+ if (bits == null)
+ throw new IllegalStateException("cannot set a bit of an empty mutator");
+ bits[bits.length - bitIndex - 1] = bit;
+ }
+
+ /**
+ * Returns the most significant bit at <code>bitIndex</code>. (leftmost bit of a binary number at the given index)
+ */
+ public Bit getMSBit(int bitIndex)
+ {
+ if (bits == null)
+ throw new IllegalStateException("cannot get a bit of an empty mutator");
+ return bits[bitIndex];
+ }
+
+ /**
+ * Returns the least significant bit at <code>bitIndex</code>. (rightmost bit of a binary number at the given index)
+ */
+ public Bit getLSBit(int bitIndex)
+ {
+ if (bits == null)
+ throw new IllegalStateException("cannot get a bit of an empty mutator");
+ return bits[bits.length - bitIndex - 1];
+ }
+
+ public int width()
+ {
+ if (bits == null)
+ throw new IllegalStateException("cannot obtain a width of an empty mutator");
+ return bits.length;
+ }
+