| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private final int | |
| private static final byte[][] | |
| private final byte[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public | BitArray(int length, byte[] a)
Creates a BitArray of the specified size, initialized from the specified byte array. |
| public | BitArray(int length, byte[] a, int ofs)
Creates a BitArray of the specified size, initialized from the specified byte array starting at the specified offset. |
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public boolean | |
| public int | Returns: a hash code value for this bit arrayOverrides java. Returns a hash code value for this bit array. |
| public int | |
| private static int | |
| public void | |
| private static int | |
| public boolean[] | |
| public byte[] | |
| public String | |
| public BitArray |
| BITS_PER_UNIT | back to summary |
|---|---|
| private static final int BITS_PER_UNIT | |
| BYTES_PER_LINE | back to summary |
|---|---|
| private static final int BYTES_PER_LINE | |
| length | back to summary |
|---|---|
| private final int length | |
| NYBBLE | back to summary |
|---|---|
| private static final byte[][] NYBBLE | |
| repn | back to summary |
|---|---|
| private final byte[] repn | |
| BitArray | back to summary |
|---|---|
| public BitArray(int length) throws IllegalArgumentException Creates a BitArray of the specified size, initialized to zeros. | |
| BitArray | back to summary |
|---|---|
| public BitArray(int length, byte[] a) throws IllegalArgumentException Creates a BitArray of the specified size, initialized from the
specified byte array. The most significant bit of | |
| BitArray | back to summary |
|---|---|
| public BitArray(int length, byte[] a, int ofs) throws IllegalArgumentException Creates a BitArray of the specified size, initialized from the
specified byte array starting at the specified offset. The most
significant bit of | |
| BitArray | back to summary |
|---|---|
| public BitArray(boolean[] bits) Create a BitArray whose bits are those of the given array of Booleans.
| |
| BitArray | back to summary |
|---|---|
| private BitArray(BitArray ba) Copy constructor (for cloning). | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| get | back to summary |
|---|---|
| public boolean get(int index) throws ArrayIndexOutOfBoundsException Returns the indexed bit in this BitArray. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code value for this bit array.
| |
| length | back to summary |
|---|---|
| public int length() Returns the length of this BitArray. | |
| position | back to summary |
|---|---|
| private static int position(int idx) | |
| set | back to summary |
|---|---|
| public void set(int index, boolean value) throws ArrayIndexOutOfBoundsException Sets the indexed bit in this BitArray. | |
| subscript | back to summary |
|---|---|
| private static int subscript(int idx) | |
| toBooleanArray | back to summary |
|---|---|
| public boolean[] toBooleanArray() Return a boolean array with the same bit values in this BitArray. | |
| toByteArray | back to summary |
|---|---|
| public byte[] toByteArray() Returns a Byte array containing the contents of this BitArray. The bit stored at index zero in this BitArray will be copied into the most significant bit of the zeroth element of the returned byte array. The last byte of the returned byte array will contain zeros in any bits that do not have corresponding bits in the BitArray. (This matters only if the BitArray's size is not a multiple of 8.) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this BitArray. | |
| truncate | back to summary |
|---|---|
| public BitArray truncate() | |