public class BitField
extends java.lang.Object
コンストラクタ | 説明 |
---|---|
BitField(byte[] bitfield,
int size) |
Creates a new BitField that represents
size bits
as set by the given byte array. |
BitField(int size) |
Creates a new BitField that represents
size unset bits. |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
void |
clear(int bit) |
Sets the given bit to false.
|
boolean |
complete() |
Return true if all bits are set.
|
int |
count() |
Return the number of set bits.
|
boolean |
equals(java.lang.Object o) |
|
boolean |
get(int bit) |
Return true if the bit is set or false if it is not.
|
byte[] |
getFieldBytes() |
This returns the actual byte array used.
|
int |
hashCode() |
|
void |
set(int bit) |
Sets the given bit to true.
|
void |
setAll() |
Sets all bits to true.
|
int |
size() |
Return the size of the BitField.
|
java.lang.String |
toString() |
public BitField(int size)
size
unset bits.public BitField(byte[] bitfield, int size)
size
bits
as set by the given byte array. This will make a copy of the array.
Extra bytes will be ignored.java.lang.IndexOutOfBoundsException
- if give byte array is not large
enough.public byte[] getFieldBytes()
public int size()
public void set(int bit)
java.lang.IndexOutOfBoundsException
- if bit is smaller then zero
bigger then size (inclusive).public void clear(int bit)
java.lang.IndexOutOfBoundsException
- if bit is smaller then zero
bigger then size (inclusive).public void setAll()
public boolean get(int bit)
java.lang.IndexOutOfBoundsException
- if bit is smaller then zero
bigger then size (inclusive).public int count()
public boolean complete()
public int hashCode()
hashCode
クラス内 java.lang.Object
public boolean equals(java.lang.Object o)
equals
クラス内 java.lang.Object
public java.lang.String toString()
toString
クラス内 java.lang.Object