org.objectweb.jorm.naming.lib
Class BasicStringCoder

java.lang.Object
  |
  +--org.objectweb.jorm.naming.lib.BasicStringCoder
All Implemented Interfaces:
PNCStringCoder

public class BasicStringCoder
extends java.lang.Object
implements PNCStringCoder

The coding format supported by this coder is the following one: - char is coded as is (example 'A' <-> "A" - byte, short, int, long are coded to hexadecimal fixed size strings (example 395/short <-> "018B") - string is coded with its encoded short length followed by the string as is (example "Hello world!" <-> "000CHello World!" - date is coded with its encoded byte length followed by its string representation (example Date(837039928046) <-> "1407/10/96 4:5 PM, PDT"

Author:
P. D?chamboux

Constructor Summary
BasicStringCoder()
           
BasicStringCoder(java.lang.String en)
           
 
Method Summary
 byte getByte()
           
 char getChar()
           
 java.util.Date getDate()
           
 int getInt()
           
 long getLong()
           
 java.lang.Byte getObyte()
           
 java.lang.Character getOchar()
           
 java.lang.Integer getOint()
           
 java.lang.Long getOlong()
           
 java.lang.Short getOshort()
           
 short getShort()
           
 java.lang.String getString()
           
 java.lang.String getStringCode()
           
 void putByte(byte val)
           
 void putChar(char val)
           
 void putDate(java.util.Date val)
           
 void putInt(int val)
           
 void putLong(long val)
           
 void putObyte(java.lang.Byte val)
           
 void putOchar(java.lang.Character val)
           
 void putOint(java.lang.Integer val)
           
 void putOlong(java.lang.Long val)
           
 void putOshort(java.lang.Short val)
           
 void putShort(short val)
           
 void putString(java.lang.String val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicStringCoder

public BasicStringCoder()

BasicStringCoder

public BasicStringCoder(java.lang.String en)
Method Detail

getByte

public byte getByte()
             throws PExceptionCoder
Specified by:
getByte in interface PNCStringCoder

getObyte

public java.lang.Byte getObyte()
                        throws PExceptionCoder
Specified by:
getObyte in interface PNCStringCoder

getChar

public char getChar()
             throws PExceptionCoder
Specified by:
getChar in interface PNCStringCoder

getOchar

public java.lang.Character getOchar()
                             throws PExceptionCoder
Specified by:
getOchar in interface PNCStringCoder

getShort

public short getShort()
               throws PExceptionCoder
Specified by:
getShort in interface PNCStringCoder

getOshort

public java.lang.Short getOshort()
                          throws PExceptionCoder
Specified by:
getOshort in interface PNCStringCoder

getInt

public int getInt()
           throws PExceptionCoder
Specified by:
getInt in interface PNCStringCoder

getOint

public java.lang.Integer getOint()
                          throws PExceptionCoder
Specified by:
getOint in interface PNCStringCoder

getLong

public long getLong()
             throws PExceptionCoder
Specified by:
getLong in interface PNCStringCoder

getOlong

public java.lang.Long getOlong()
                        throws PExceptionCoder
Specified by:
getOlong in interface PNCStringCoder

getString

public java.lang.String getString()
                           throws PExceptionCoder
Specified by:
getString in interface PNCStringCoder

getDate

public java.util.Date getDate()
                       throws PExceptionCoder
Specified by:
getDate in interface PNCStringCoder

putByte

public void putByte(byte val)
             throws PExceptionCoder
Specified by:
putByte in interface PNCStringCoder

putObyte

public void putObyte(java.lang.Byte val)
              throws PExceptionCoder
Specified by:
putObyte in interface PNCStringCoder

putChar

public void putChar(char val)
             throws PExceptionCoder
Specified by:
putChar in interface PNCStringCoder

putOchar

public void putOchar(java.lang.Character val)
              throws PExceptionCoder
Specified by:
putOchar in interface PNCStringCoder

putShort

public void putShort(short val)
              throws PExceptionCoder
Specified by:
putShort in interface PNCStringCoder

putOshort

public void putOshort(java.lang.Short val)
               throws PExceptionCoder
Specified by:
putOshort in interface PNCStringCoder

putInt

public void putInt(int val)
            throws PExceptionCoder
Specified by:
putInt in interface PNCStringCoder

putOint

public void putOint(java.lang.Integer val)
             throws PExceptionCoder
Specified by:
putOint in interface PNCStringCoder

putLong

public void putLong(long val)
             throws PExceptionCoder
Specified by:
putLong in interface PNCStringCoder

putOlong

public void putOlong(java.lang.Long val)
              throws PExceptionCoder
Specified by:
putOlong in interface PNCStringCoder

putString

public void putString(java.lang.String val)
               throws PExceptionCoder
Specified by:
putString in interface PNCStringCoder

putDate

public void putDate(java.util.Date val)
             throws PExceptionCoder
Specified by:
putDate in interface PNCStringCoder

getStringCode

public java.lang.String getStringCode()
                               throws PExceptionCoder
Specified by:
getStringCode in interface PNCStringCoder