org.llrp.ltk.types
Class UnsignedLong

java.lang.Object
  extended by org.llrp.ltk.types.LLRPType
      extended by org.llrp.ltk.types.LLRPNumberType
          extended by org.llrp.ltk.types.UnsignedLong
Direct Known Subclasses:
UnsignedLong_DATETIME

public class UnsignedLong
extends LLRPNumberType

Unsigned Long


Field Summary
protected static int LENGTH
           
protected  java.math.BigInteger value
           
 
Fields inherited from class org.llrp.ltk.types.LLRPNumberType
signed
 
Constructor Summary
UnsignedLong()
           
UnsignedLong(org.jdom.Element element)
          Creates a new UnsignedLong object from jdom element - used for xml decoding
UnsignedLong(LLRPBitList bitList)
          Creates a new UnsignedLong object.
UnsignedLong(java.lang.Long value)
          Creates a new UnsignedLong object.
UnsignedLong(java.lang.String string)
           
UnsignedLong(java.lang.String valueString, int radix)
          String representation in specified radix.
 
Method Summary
 void decodeBinary(LLRPBitList bitList)
          decode to binary representation
 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 equals(LLRPNumberType other)
          compare
 int hashCode()
           
 boolean inRange(long value)
           
 boolean inRange(java.lang.String valueString)
           
static int length()
          number of bits used to represent this type
 java.math.BigInteger toBigInteger()
          UnsignedLong wrapped Integero BigInteger
 java.lang.Integer toInteger()
          number of bits used to represent this type
 long toLong()
          this might return a false value.
 java.lang.String toString(int radix)
           
 
Methods inherited from class org.llrp.ltk.types.LLRPNumberType
equals, intValue, toString
 
Methods inherited from class org.llrp.ltk.types.LLRPType
toXMLString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LENGTH

protected static final int LENGTH
See Also:
Constant Field Values

value

protected java.math.BigInteger value
Constructor Detail

UnsignedLong

public UnsignedLong()

UnsignedLong

public UnsignedLong(java.lang.Long value)
Creates a new UnsignedLong object.

Parameters:
value - to set

UnsignedLong

public UnsignedLong(org.jdom.Element element)
Creates a new UnsignedLong object from jdom element - used for xml decoding

Parameters:
element - to be decoded

UnsignedLong

public UnsignedLong(java.lang.String valueString,
                    int radix)
String representation in specified radix.


UnsignedLong

public UnsignedLong(java.lang.String string)
Parameters:
string - radix 10

UnsignedLong

public UnsignedLong(LLRPBitList bitList)
Creates a new UnsignedLong object.

Parameters:
bitList - to be decoded
Method Detail

decodeBinary

public void decodeBinary(LLRPBitList bitList)
decode to binary representation

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

equals

public boolean equals(LLRPNumberType other)
compare

Parameters:
other - to compare
Returns:
boolean

length

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

Returns:
Integer

toBigInteger

public java.math.BigInteger toBigInteger()
UnsignedLong wrapped Integero BigInteger

Returns:
BigInteger

toInteger

public java.lang.Integer toInteger()
number of bits used to represent this type

Specified by:
toInteger in class LLRPNumberType
Returns:
Integer

toLong

public long toLong()
this might return a false value. Java long are signed and therefore might not provide enough precision

Returns:
long

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

encodeBinary

public LLRPBitList encodeBinary()
Description copied from class: LLRPType
encode this value

Specified by:
encodeBinary in class LLRPType
Returns:
LLRPBitList

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

hashCode

public int hashCode()
Overrides:
hashCode in class LLRPNumberType

toString

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

inRange

public boolean inRange(long value)
Specified by:
inRange in class LLRPNumberType

inRange

public boolean inRange(java.lang.String valueString)
Specified by:
inRange in class LLRPType


Copyright © 2007 ETH Zurich.