org.llrp.ltk.types
Class UTF8String

java.lang.Object
  extended by org.llrp.ltk.types.LLRPType
      extended by org.llrp.ltk.types.UTF8String
Direct Known Subclasses:
UTF8String_UTF_8

public class UTF8String
extends LLRPType

Strig with UT8 Encoding!


Field Summary
protected static java.lang.Integer LENGTH
           
protected  java.lang.String string
           
 
Constructor Summary
protected UTF8String()
           
  UTF8String(org.jdom.Element element)
          Creates a new UTF8String object from jdom element - used for xml decoding
  UTF8String(LLRPBitList subList)
          Creates a new UTF8String object.
  UTF8String(java.lang.String string)
          Creates a new UTF8String object.
 
Method Summary
 void decodeBinary(LLRPBitList list)
          decode bits from BitList.
 void decodeXML(org.jdom.Element element)
          create objects from xml.
 LLRPBitList encodeBinary()
          encode to binary representation
 org.jdom.Content encodeXML(java.lang.String name, org.jdom.Namespace ns)
          create xml representation of this parameter.
 boolean equals(LLRPType other)
          compare two UTF8Strings
 java.lang.Integer getByteLength()
          number of bytes used to represent this type
 int hashCode()
           
 boolean inRange(java.lang.String valueString)
           
static int length()
          return number of bits used to represent this type
 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

LENGTH

protected static java.lang.Integer LENGTH

string

protected java.lang.String string
Constructor Detail

UTF8String

protected UTF8String()

UTF8String

public UTF8String(LLRPBitList subList)
Creates a new UTF8String object.

Parameters:
subList - to be decoded

UTF8String

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

Parameters:
element - to be decoded

UTF8String

public UTF8String(java.lang.String string)
Creates a new UTF8String object.

Parameters:
string - to be represented
Method Detail

decodeBinary

public void decodeBinary(LLRPBitList list)
decode bits from BitList.

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

length

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

Returns:
Integer

encodeBinary

public LLRPBitList encodeBinary()
encode to binary representation

Specified by:
encodeBinary in class LLRPType
Returns:
LLRPBitList

equals

public boolean equals(LLRPType other)
compare two UTF8Strings

Parameters:
other - to compare
Returns:
boolean

getByteLength

public java.lang.Integer getByteLength()
number of bytes used to represent this type

Returns:
Integer

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)
create xml representation of this parameter. This method will check the supplied string to see if it only contains characters allowed by the XML 1.0 specification. The C0 controls (e.g. null, vertical tab, formfeed, etc.) are removed except for carriage return, linefeed and the horizontal tab. Surrogates will throw an IllegalDataException. Note that characters like " and < are allowed in attribute values and element content. They will simply be escaped when the value is serialized.

Specified by:
encodeXML in class LLRPType
Parameters:
name - returned content should have
ns - Namespace of elements

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

hashCode

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

inRange

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


Copyright © 2007 ETH Zurich.