org.llrp.ltk.types
Class SignedShortArray

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

public class SignedShortArray
extends LLRPType

Array of 16 bit signed shorts - length encoded in first 16 bits of binary encoding


Field Summary
protected  SignedShort[] shorts
           
 
Constructor Summary
SignedShortArray()
          Creates an empty SignedShortArray.
SignedShortArray(org.jdom.Element element)
          Creates a new SignedShortArray object from jdom element - used for xml decoding
SignedShortArray(int length)
          Creates a new SignedShortArray object.
SignedShortArray(LLRPBitList bits)
          first 16 bits of LLRPBitlist must indicate number of entries that follow
SignedShortArray(short[] data)
           
SignedShortArray(SignedShort[] shorts)
          Creates a new SignedShortArray object.
SignedShortArray(java.lang.String shortString)
          Creates a new SignedShortArray object.
 
Method Summary
 void add(SignedShort 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
 SignedShort get(int i)
          get SignedShort 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, SignedShort b)
          set SignedShort 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 SignedShort[] shorts
Constructor Detail

SignedShortArray

public SignedShortArray(SignedShort[] shorts)
Creates a new SignedShortArray object.

Parameters:
shorts - to create array from

SignedShortArray

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

Parameters:
shortString - of shorts

SignedShortArray

public SignedShortArray(short[] data)

SignedShortArray

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

Parameters:
element - to be decoded

SignedShortArray

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

Parameters:
length - of array

SignedShortArray

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

Parameters:
bits - to be decoded

SignedShortArray

public SignedShortArray()
Creates an empty SignedShortArray. Do not call method 'set' on an empty array. Add SignedShorts 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 SignedShort get(int i)
get SignedShort at specified position

Parameters:
i - position
Returns:
SignedShort

getBitLength

public int getBitLength()
lenght in bits

Returns:
Integer

getByteLength

public int getByteLength()
length in bytes

Returns:
Integer

length

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

Returns:
int

set

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

Parameters:
i - position
b - SignedShort 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(SignedShort 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.