X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Ftypes%2FBitVector.java;h=c223e819b5740af02e11d631a46f07053320da04;hb=9d4faa3eb431c46f0064c2f2a67fc369cf38dfdb;hp=3e5c17702fd8e35c124ac3cea3e4dbc6e091728a;hpb=813aa8a53a4377eb3875752aa3569bdadb971930;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVector.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVector.java index 3e5c1770..c223e819 100644 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVector.java +++ b/net.mograsim.logic.core/src/net/mograsim/logic/core/types/BitVector.java @@ -57,6 +57,19 @@ public final class BitVector implements StrictLogicType, Iterable, Iterable, Iterable + * An empty BitVectorMutator must not be converted to BitVector or used to manipulate single bits until at least one two + * operand logic operation is performed. */ public static BitVectorMutator empty() { return new BitVectorMutator(null); } + /** + * @see #empty() + */ + public boolean isEmpty() + { + return bits == null; + } + /** * Produces the resulting, immutable {@link BitVector}
* @@ -278,6 +307,8 @@ public final class BitVector implements StrictLogicType, Iterable, Iterable, Iterable, Iterable, Iterableoffset to the right.
- * Therefore offset + other.length() <= this.length() needs to be true. + * Therefore offset + other.length() <= this.wdith() needs to be true. * * @throws ArrayIndexOutOfBoundsException if offset + other.length() > this.length() * @@ -371,6 +410,33 @@ public final class BitVector implements StrictLogicType, Iterable, Iterablefrom MSB to LSB (left to right). */