org.llrp.ltk.types
Class TwoBitField

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

public class TwoBitField
extends LLRPType

TwoBitField - a field consisting of two bits


Constructor Summary
TwoBitField()
          Creates a new TwoBitField object.
TwoBitField(Bit[] bits)
          Generate a list of bits
TwoBitField(org.jdom.Element element)
          Creates a new TwoBitField object.
TwoBitField(LLRPBitList list)
          Creates a new TwoBitField object.
TwoBitField(java.lang.String string)
           
 
Method Summary
 void clear(java.lang.Integer i)
          set Bit at specified position to 0
 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(java.lang.Integer i)
          get bit at I
 boolean inRange(java.lang.String valueString)
          expects a string as formated for XML
 int intValue()
          two bit field interpreted as two bit number
static int length()
          number of bits used to represent this type
 void set(java.lang.Integer i)
          set Bit at specified position to 1
 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

TwoBitField

public TwoBitField(Bit[] bits)
Generate a list of bits

Parameters:
bits - to be decoded

TwoBitField

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

Parameters:
list - to be decoded

TwoBitField

public TwoBitField(java.lang.String string)
Parameters:
string -

TwoBitField

public TwoBitField()
Creates a new TwoBitField object.


TwoBitField

public TwoBitField(org.jdom.Element element)
Creates a new TwoBitField object.

Parameters:
element - to be decoded
Method Detail

clear

public void clear(java.lang.Integer i)
set Bit at specified position to 0

Parameters:
i - position to be set to 0

encodeBinary

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

Specified by:
encodeBinary in class LLRPType
Returns:
LLRPBitList

length

public static int length()
number of bits used to represent this type

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(java.lang.Integer i)
get bit at I

Parameters:
i - position to be returned
Returns:
bIT

intValue

public int intValue()
two bit field interpreted as two bit number

Returns:
int

set

public void set(java.lang.Integer i)
set Bit at specified position to 1

Parameters:
i - position to be set to 1

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

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.