org.llrp.ltk.types
Class UnsignedShort

java.lang.Object
  extended by org.llrp.ltk.types.LLRPType
      extended by org.llrp.ltk.types.LLRPNumberType
          extended by org.llrp.ltk.types.UnsignedShort
Direct Known Subclasses:
CommunicationsStandard, ConnectionAttemptStatusType, NotificationEventType, StatusCode

public class UnsignedShort
extends LLRPNumberType

unsigned 16bit short


Field Summary
protected  java.lang.Integer value
           
 
Fields inherited from class org.llrp.ltk.types.LLRPNumberType
signed
 
Constructor Summary
UnsignedShort()
          Creates a new UnsignedShort object.
UnsignedShort(org.jdom.Element element)
          Creates a new UnsignedShort object from jdom element - used for xml decoding
UnsignedShort(int value)
           
UnsignedShort(java.lang.Integer value)
          Creates a new UnsignedShort object.
UnsignedShort(LLRPBitList bitList)
          Creates a new UnsignedShort object.
UnsignedShort(java.lang.Short value)
          Creates a new UnsignedShort object - might loose precision
UnsignedShort(java.lang.String valueString)
          Creates a new UnsignedShort object.
UnsignedShort(java.lang.String valueString, int radix)
          String representation in specified radix.
 
Method Summary
 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()
           
 java.lang.Integer toInteger()
          wrap UnsignedShort Integero Integer
 short toShort()
          this might return a false value.
 java.lang.String toString(int radix)
           
 
Methods inherited from class org.llrp.ltk.types.LLRPNumberType
equals, hashCode, 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

value

protected java.lang.Integer value
Constructor Detail

UnsignedShort

public UnsignedShort(java.lang.Short value)
Creates a new UnsignedShort object - might loose precision

Parameters:
value - to set

UnsignedShort

public UnsignedShort(int value)

UnsignedShort

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

Parameters:
element - to be decoded

UnsignedShort

public UnsignedShort()
Creates a new UnsignedShort object.


UnsignedShort

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


UnsignedShort

public UnsignedShort(java.lang.Integer value)
Creates a new UnsignedShort object.

Parameters:
value - to set

UnsignedShort

public UnsignedShort(java.lang.String valueString)
Creates a new UnsignedShort object.

Parameters:
valueString - value as string

UnsignedShort

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

Parameters:
bitList - to be decoded
Method Detail

encodeBinary

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

Specified by:
encodeBinary in class LLRPType
Returns:
LLRPBitList

length

public static int length()
Returns:
int

toInteger

public java.lang.Integer toInteger()
wrap UnsignedShort Integero Integer

Specified by:
toInteger in class LLRPNumberType
Returns:
Integer

intValue

public int intValue()
Overrides:
intValue in class LLRPNumberType

toShort

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

Returns:
short

decodeBinary

public void decodeBinary(LLRPBitList list)
Description copied from class: LLRPType
decode

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

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

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

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.