public class Bit extends LLRPNumberType
Modifier and Type | Field and Description |
---|---|
protected boolean |
value |
signed
Constructor and Description |
---|
Bit()
initially set to 0.
|
Bit(boolean x)
create a 7bit.
|
Bit(java.lang.Boolean bool)
everything but 0 is interpreted as 1.
|
Bit(org.jdom.Element element)
Creates a new Bit object from jdom element - used for xml decoding.
|
Bit(int x)
create a bit.
|
Bit(java.lang.Integer i) |
Bit(LLRPBitList bitList)
create a bit.
|
Bit(LLRPBitList bitList,
int bitIndex,
int length) |
Bit(java.lang.String x)
create a bit.
|
Modifier and Type | Method and Description |
---|---|
void |
decodeBinary(LLRPBitList list)
decode
|
void |
decodeXML(org.jdom.Element element)
create objects from xml.
|
LLRPBitList |
encodeBinary()
encode this value
|
org.jdom.Content |
encodeXML(java.lang.String name,
org.jdom.Namespace ns)
create xml representation of this parameter.
|
boolean |
inRange(long value) |
boolean |
inRange(java.lang.String valueString) |
int |
intValue() |
static int |
length()
length in number of bits used to represent this type.
|
boolean |
toBoolean()
0 is false, 1 is true.
|
byte |
toByte()
bit as byte - the last bit is set or not.
|
java.lang.Integer |
toInteger()
either 0 or 1.
|
java.lang.String |
toString()
String representation
|
java.lang.String |
toString(int radix) |
equals, hashCode
toXMLString
public Bit(LLRPBitList bitList, int bitIndex, int length)
public Bit()
public Bit(int x)
x
- -
everything but 0 is interpreted as 1public Bit(boolean x)
x
- public Bit(java.lang.Integer i)
public Bit(java.lang.String x)
x
- -
everything but 0 is interpreted as 1public Bit(LLRPBitList bitList)
bitList
- -
everything but 0 is interpreted as 1public Bit(java.lang.Boolean bool)
bool
- initial valuepublic Bit(org.jdom.Element element)
element
- to be decodedpublic static int length()
public boolean toBoolean()
public byte toByte()
public java.lang.Integer toInteger()
toInteger
in class LLRPNumberType
public int intValue()
intValue
in class LLRPNumberType
public void decodeXML(org.jdom.Element element)
LLRPType
public org.jdom.Content encodeXML(java.lang.String name, org.jdom.Namespace ns)
LLRPType
public void decodeBinary(LLRPBitList list)
LLRPType
decodeBinary
in class LLRPType
list
- to be decodedpublic LLRPBitList encodeBinary()
LLRPType
encodeBinary
in class LLRPType
public java.lang.String toString()
LLRPType
toString
in class LLRPNumberType
public boolean inRange(long value)
inRange
in class LLRPNumberType
Copyright © 2007 ETH Zurich.