|
LimeWire Collection Component API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limewire.collection.BitNumbers
public class BitNumbers
Allows storage & retrieval of numbers based on the index of an on or off bit in a byte[] or a hexadecimal String representation of that byte[].
| Field Summary | |
|---|---|
static BitNumbers |
EMPTY_BN
A convenient shared immutable empty BitNumbers. |
| Constructor Summary | |
|---|---|
BitNumbers(byte[] data)
Constructs a BitNumbers backed by the given byte[]. |
|
BitNumbers(int size)
Constructs a BitNumbers large enough to store numbers up to size. |
|
BitNumbers(String hexString)
Constructs a BitNumbers based on the given hex string. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
int |
getMax()
Returns the maximum number that can be stored in this BitNumbers. |
int |
hashCode()
|
boolean |
isEmpty()
Returns true if no set bits exist. |
boolean |
isSet(int idx)
Returns true if the correct bit is set. |
void |
set(int idx)
Sets the bit corresponding to the index. |
static BitNumbers |
synchronizedBitNumbers(BitNumbers delegate)
|
byte[] |
toByteArray()
Returns the byte array that BitNumbers is backed off of. |
String |
toHexString()
A hexadecimal representation of the byte[] |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final BitNumbers EMPTY_BN
| Constructor Detail |
|---|
public BitNumbers(byte[] data)
public BitNumbers(int size)
public BitNumbers(String hexString)
throws IllegalArgumentException
IllegalArgumentException| Method Detail |
|---|
public boolean isSet(int idx)
public int getMax()
public void set(int idx)
public byte[] toByteArray()
public boolean isEmpty()
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toHexString()
public String toString()
toString in class Objectpublic static BitNumbers synchronizedBitNumbers(BitNumbers delegate)
|
LimeWire Collection Component API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||