|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Number de.lmu.ifi.dbs.elki.data.Bit
public class Bit
Provides a bit number. The bit is internally represented as boolean.
Field Summary | |
---|---|
private boolean |
bit
Internal representation of the bit value. |
static Pattern |
BIT_PATTERN
Pattern defining valid bit values. |
private static long |
serialVersionUID
Generated serial version UID. |
Constructor Summary | |
---|---|
Bit(boolean bit)
Provides a new bit according to the specified boolean value. |
|
Bit(int bit)
Provides a new bit according to the specified integer value. |
Method Summary | |
---|---|
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(String bit)
Method to construct a Bit for a given String expression. |
Methods inherited from class java.lang.Number |
---|
byteValue, shortValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public static final Pattern BIT_PATTERN
private boolean bit
Constructor Detail |
---|
public Bit(boolean bit)
bit
- the boolean value of this bitpublic Bit(int bit) throws IllegalArgumentException
bit
- 1 for true and 0 for false
IllegalArgumentException
- if the specified value is neither 0 nor 1.Method Detail |
---|
public static Bit valueOf(String bit) throws NumberFormatException
bit
- a String expression defining a Bit
NumberFormatException
- if the given String expression does not fit
to the Pattern BIT_PATTERN
public int intValue()
intValue
in class Number
public long longValue()
intValue()
.
longValue
in class Number
public float floatValue()
intValue()
.
floatValue
in class Number
public double doubleValue()
intValue()
.
doubleValue
in class Number
public boolean bitValue()
public String toString()
intValue()
.
toString
in class Object
Object.toString()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |