|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsu.util.ConvertableBitSet
This class extends the functionality of java.util.BitSet. Since java.util.BitSet is a final class, ConvertableBitSet is not a subclass of java.util.BitSet. It adds the ablity to convert between basic types (ints, float) and BitSet objects.
Constructor Summary | |
ConvertableBitSet()
|
|
ConvertableBitSet(int size)
Contructs a BitSet object with given number of bits, all set to zero. |
Method Summary | |
void |
and(java.util.BitSet set)
Logically ANDs current ConvertableBitSet with the specified BitSet. |
void |
and(ConvertableBitSet set)
Logically ANDs current ConvertableBitSet with the specified ConvertableBitSet. |
void |
clear(int bit)
Sets the given bit to zero (or false). |
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object anObject)
|
static ConvertableBitSet |
fromDouble(double value)
Returns the bitset representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout. |
static ConvertableBitSet |
fromFloat(float value)
Returns the bitset represention of a single-float value. |
static ConvertableBitSet |
fromInt(int value)
|
static ConvertableBitSet |
fromLong(long value)
|
static ConvertableBitSet |
fromString(java.lang.String bits)
|
boolean |
get(int bit)
Returns the value of the given bit. |
int |
hashCode()
|
void |
or(java.util.BitSet set)
Logically ORs current ConvertableBitSet with the specified BitSet. |
void |
or(ConvertableBitSet set)
Logically ORs current ConvertableBitSet with the specified ConvertableBitSet. |
void |
set(int bit)
Sets the given bit to one (or true). |
int |
size()
Returns the number of bits in the ConvertableBitSet. |
double |
toDouble()
Constucts a double from the bitset. |
java.lang.String |
toDoubleString()
Return a string representation of the ConvertableBitSet as if it represented a double. |
float |
toFloat()
Constucts a float from the bitset. |
java.lang.String |
toFloatString()
Return a string representation of the ConvertableBitSet as if it represented a float. |
int |
toInt()
Constucts an int from the bitset. |
int |
toLong()
Constucts an int from the bitset. |
java.lang.String |
toString()
Returns a string representation of the bitset. |
java.lang.String |
toString(int numberOfBits)
Returns a String representation of the bitset using the first numberOfBits of the bitset. |
void |
xor(java.util.BitSet set)
Logically XORs current ConvertableBitSet with the specified BitSet. |
void |
xor(ConvertableBitSet set)
Logically XORs current ConvertableBitSet with the specified ConvertableBitSet. |
Methods inherited from class java.lang.Object |
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public ConvertableBitSet()
public ConvertableBitSet(int size)
Method Detail |
public static ConvertableBitSet fromString(java.lang.String bits)
bits
- a string representation of the bits. All characters
in the string must be '0' or '1'. The low order bit is on the right end
of the stringpublic static ConvertableBitSet fromInt(int value)
public static ConvertableBitSet fromLong(long value)
public static ConvertableBitSet fromFloat(float value)
Bit 31 represents the sign of the floating-point number. Bits 30-23 represent the exponent. Bits 22-0 represent the mantissa (or significand) of the floating-point number.
If the argument is positive infinity, the result is 0x7f800000.
If the argument is negative infinity, the result is 0xff800000.
If the argument is NaN, the result is 0x7fc00000.
public static ConvertableBitSet fromDouble(double value)
Bit 63 represents the sign of the floating-point number. Bits 62-52 represent the exponent. Bits 51-0 represent the mantissa or significand of the floating-point number.
If the argument is positive infinity, the result is 0x7ff0000000000000L.
If the argument is negative infinity, the result is 0xfff0000000000000L.
If the argument is NaN, the result is 0x7ff8000000000000L.
public float toFloat()
public double toDouble()
public int toInt()
public int toLong()
public void and(ConvertableBitSet set)
public void and(java.util.BitSet set)
public void or(java.util.BitSet set)
public void or(ConvertableBitSet set)
public void xor(java.util.BitSet set)
public void xor(ConvertableBitSet set)
public void clear(int bit)
public boolean get(int bit)
public void set(int bit)
public int hashCode()
public int size()
public boolean equals(java.lang.Object anObject)
public java.lang.Object clone()
public java.lang.String toString()
public java.lang.String toString(int numberOfBits)
public java.lang.String toFloatString()
public java.lang.String toDoubleString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |