org.llrp.ltk.types
Class BitList

java.lang.Object
  extended by org.llrp.ltk.types.LLRPType
      extended by org.llrp.ltk.types.BitList

public class BitList
extends LLRPType

List of Bits - length not encoded!


Constructor Summary
BitList()
          Creates a new BitList object.
BitList(Bit[] bits)
          Generate a list of bits - bit[0] is the least significant bit.
BitList(int l)
          Generate a list of bits.
BitList(java.lang.Integer... integers)
           
BitList(java.lang.Integer l)
           
BitList(LLRPBitList list)
          Creates a new BitList object.
BitList(java.lang.String bitString)
          create BitList - String must consist of numbers only.
 
Method Summary
 void clear(int i)
          set Bit at specified position to 0.
 void clear(java.lang.Integer i)
           
 void decodeBinary(LLRPBitList list)
          decode bits from BitList.
 void decodeXML(org.jdom.Element element)
          create objects from xml.
 LLRPBitList encodeBinary()
          just like BitArray but does not encode length before values.
 org.jdom.Content encodeXML(java.lang.String name, org.jdom.Namespace ns)
          create xml representation of this parameter.
 Bit get(int i)
          get bit at specified position.
 Bit get(java.lang.Integer i)
           
 boolean inRange(java.lang.String valueString)
          expects a string as formated for XML
 int intValue()
           
 int length()
          length of the list.
 void set(int i)
          set Bit at specified position to 1.
 void set(java.lang.Integer i)
           
 void setValue(int value)
           
 java.lang.Integer toInteger()
           
 java.lang.String toString()
          String representation
 java.lang.String toString(int radix)
           
 
Methods inherited from class org.llrp.ltk.types.LLRPType
toXMLString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitList

public BitList(Bit[] bits)
Generate a list of bits - bit[0] is the least significant bit.

Parameters:
bits - to be decoded

BitList

public BitList(java.lang.String bitString)
create BitList - String must consist of numbers only. Everything but 0 is interpreted as 1

Parameters:
bitString - to be decoded

BitList

public BitList(LLRPBitList list)
Creates a new BitList object.

Parameters:
list - to be decoded

BitList

public BitList(java.lang.Integer... integers)

BitList

public BitList(int l)
Generate a list of bits. All bits initially set to 0

Parameters:
l - length

BitList

public BitList(java.lang.Integer l)

BitList

public BitList()
Creates a new BitList object.

Method Detail

setValue

public void setValue(int value)

clear

public void clear(int i)
set Bit at specified position to 0.

Parameters:
i - position to clear

clear

public void clear(java.lang.Integer i)

encodeBinary

public LLRPBitList encodeBinary()
just like BitArray but does not encode length before values.

Specified by:
encodeBinary in class LLRPType
Returns:
LLRPBitList

length

public int length()
length of the list.

Returns:
Integer

decodeBinary

public void decodeBinary(LLRPBitList list)
decode bits from BitList. Length must not be provided

Specified by:
decodeBinary in class LLRPType
Parameters:
list - to be decoded

get

public Bit get(int i)
get bit at specified position.

Parameters:
i - position to get
Returns:
Bit

get

public Bit get(java.lang.Integer i)

set

public void set(int i)
set Bit at specified position to 1.

Parameters:
i - position to be set

set

public void set(java.lang.Integer i)

encodeXML

public org.jdom.Content encodeXML(java.lang.String name,
                                  org.jdom.Namespace ns)
Description copied from class: LLRPType
create xml representation of this parameter.

Specified by:
encodeXML in class LLRPType
Parameters:
name - returned content should have
ns - Namespace of elements

decodeXML

public void decodeXML(org.jdom.Element element)
Description copied from class: LLRPType
create objects from xml.

Specified by:
decodeXML in class LLRPType
Parameters:
element - to be decoded

toInteger

public java.lang.Integer toInteger()

intValue

public int intValue()

toString

public java.lang.String toString()
Description copied from class: LLRPType
String representation

Overrides:
toString in class LLRPType
Returns:
String

toString

public java.lang.String toString(int radix)
Specified by:
toString in class LLRPType

inRange

public boolean inRange(java.lang.String valueString)
expects a string as formated for XML

Specified by:
inRange in class LLRPType


Copyright © 2007 ETH Zurich.