org.llrp.ltk.types
Class UnsignedShortArray

java.lang.Object
  extended by org.llrp.ltk.types.LLRPType
      extended by org.llrp.ltk.types.UnsignedShortArray
Direct Known Subclasses:
UnsignedShortArray_HEX

public class UnsignedShortArray
extends LLRPType

Array of UnsignedShorts - length encoded with first 16 bits in binary encoding


Field Summary
protected  UnsignedShort[] shorts
           
 
Constructor Summary
UnsignedShortArray()
          Creates an empty UnsignedShortArray.
UnsignedShortArray(org.jdom.Element element)
          Creates a new UnsignedShortArray object from jdom element - used for xml decoding
UnsignedShortArray(int length)
          Creates a new UnsignedShortArray object.
UnsignedShortArray(LLRPBitList bits)
          first 16 bits of LLRPBitlist must indicate number of entries that follow
UnsignedShortArray(short[] data)
           
UnsignedShortArray(java.lang.String shortString)
          Creates a new UnsignedShortArray object.
UnsignedShortArray(UnsignedShort[] shorts)
          Creates a new UnsignedShortArray object.
 
Method Summary
 void add(UnsignedShort aShort)
           
 void decodeBinary(LLRPBitList list)
          first 16 bits of LLRPBitlist must indicate number of entries that follow
 void decodeXML(org.jdom.Element element)
          create objects from xml.
 LLRPBitList encodeBinary()
          encodes length before encoding containing values
 org.jdom.Content encodeXML(java.lang.String name, org.jdom.Namespace ns)
          create xml representation of this parameter.
 boolean equals(LLRPType other)
          compare each element
 UnsignedShort get(int i)
          get UnsignedShort at specified position
 int getBitLength()
          lenght in bits
 int getByteLength()
          length in bytes
 int hashCode()
           
 boolean inRange(java.lang.String valueString)
          expects a string as formated for XML
static int length()
          length of BaseType not array - for array length call size()
 void set(int i, UnsignedShort b)
          set UnsignedShort at given location
 int size()
          number of elements in array
 short[] toShortArray()
           
 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, notify, notifyAll, wait, wait, wait
 

Field Detail

shorts

protected UnsignedShort[] shorts
Constructor Detail

UnsignedShortArray

public UnsignedShortArray(UnsignedShort[] shorts)
Creates a new UnsignedShortArray object.

Parameters:
shorts - to create array from

UnsignedShortArray

public UnsignedShortArray(java.lang.String shortString)
Creates a new UnsignedShortArray object.

Parameters:
shortString - string of shorts

UnsignedShortArray

public UnsignedShortArray(short[] data)

UnsignedShortArray

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

Parameters:
element - to be decoded

UnsignedShortArray

public UnsignedShortArray(int length)
Creates a new UnsignedShortArray object.

Parameters:
length - of array

UnsignedShortArray

public UnsignedShortArray(LLRPBitList bits)
first 16 bits of LLRPBitlist must indicate number of entries that follow

Parameters:
bits - to be decoded

UnsignedShortArray

public UnsignedShortArray()
Creates an empty UnsignedShortArray. Do not call method 'set' on an empty array. Add UnsignedShorts by calling the add method

Method Detail

decodeBinary

public void decodeBinary(LLRPBitList list)
first 16 bits of LLRPBitlist must indicate number of entries that follow

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

encodeBinary

public LLRPBitList encodeBinary()
encodes length before encoding containing values

Specified by:
encodeBinary in class LLRPType
Returns:
LLRPBitList

equals

public boolean equals(LLRPType other)
compare each element

Parameters:
other - to compare
Returns:
boolean

get

public UnsignedShort get(int i)
get UnsignedShort at specified position

Parameters:
i - position
Returns:
UnsignedShort

getBitLength

public int getBitLength()
lenght in bits

Returns:
Integer

getByteLength

public int getByteLength()
length in bytes

Returns:
int

length

public static int length()
length of BaseType not array - for array length call size()

Returns:
int

set

public void set(int i,
                UnsignedShort b)
set UnsignedShort at given location

Parameters:
i - position
b - UnsignedShort to be set

size

public int size()
number of elements in array

Returns:
int

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

add

public void add(UnsignedShort aShort)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toShortArray

public short[] toShortArray()

toString

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

toString

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

Overrides:
toString in class LLRPType
Returns:
String

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.