|
|
|||||||||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||||||||||
java.lang.Objectjava.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 bit
public 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_PATTERNpublic int intValue()
intValue in class Numberpublic long longValue()
intValue().
longValue in class Numberpublic 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()
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||