
public class Bit extends Number
| Modifier and Type | Field and Description |
|---|---|
private boolean |
bit
Internal representation of the bit value.
|
static Pattern |
BIT_PATTERN
Pattern defining valid bit values.
|
static Bit |
FALSE
False bit.
|
private static long |
serialVersionUID
Generated serial version UID.
|
static Bit |
TRUE
True bit.
|
| Constructor and Description |
|---|
Bit(boolean bit)
Deprecated.
Use
valueOf(java.lang.String) to save memory. |
Bit(int bit)
Deprecated.
Use
valueOf(java.lang.String) to save memory. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
bitValue()
Returns the bit value as a boolean.
|
double |
doubleValue()
Provides a double value for the integer representation of this Bit as given
by
intValue(). |
float |
floatValue()
Provides a float value for the integer representation of this Bit as given
by
intValue(). |
int |
intValue()
Provides an integer representation of the bit.
|
long |
longValue()
Provides a long value for the integer representation of this Bit as given
by
intValue(). |
String |
toString()
Provides the String representation of the integer representation of this
Bit as given by
intValue(). |
static Bit |
valueOf(boolean b)
Convert truth value to a bit.
|
static Bit |
valueOf(String bit)
Method to construct a Bit for a given String expression.
|
byteValue, shortValueprivate static final long serialVersionUID
public static final Pattern BIT_PATTERN
public static final Bit TRUE
public static final Bit FALSE
private boolean bit
@Deprecated public Bit(boolean bit)
valueOf(java.lang.String) to save memory.bit - the boolean value of this bit@Deprecated public Bit(int bit) throws IllegalArgumentException
valueOf(java.lang.String) to save memory.bit - 1 for true and 0 for falseIllegalArgumentException - if the specified value is neither 0 nor 1.public static Bit valueOf(String bit) throws NumberFormatException
bit - a String expression defining a BitNumberFormatException - if the given String expression does not fit
the defined pattern.public static Bit valueOf(boolean b)
b - Truth valuepublic int intValue()
public long longValue()
intValue().public float floatValue()
intValue().floatValue in class Numberpublic double doubleValue()
intValue().doubleValue in class Numberpublic boolean bitValue()
public String toString()
intValue().toString in class ObjectObject.toString()