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()
           
 byte[] getByteArray()
           
 char getChar()
           
 char[] getCharArray()
           
 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 putByteArray(byte[] va)
           
 void putChar(char val)
           
 void putCharArray(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 PExceptionNameCoding
Specified by:
getByte in interface PNCStringCoder
PExceptionNameCoding

getObyte

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

getChar

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

getOchar

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

getShort

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

getOshort

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

getInt

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

getOint

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

getLong

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

getOlong

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

getString

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

getDate

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

getByteArray

public byte[] getByteArray()
                    throws PExceptionNameCoding
Specified by:
getByteArray in interface PNCStringCoder
PExceptionNameCoding

getCharArray

public char[] getCharArray()
                    throws PExceptionNameCoding
Specified by:
getCharArray in interface PNCStringCoder
PExceptionNameCoding

putByte

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

putObyte

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

putChar

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

putOchar

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

putShort

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

putOshort

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

putInt

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

putOint

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

putLong

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

putOlong

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

putString

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

putDate

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

putByteArray

public void putByteArray(byte[] va)
                  throws PExceptionNameCoding
Specified by:
putByteArray in interface PNCStringCoder
PExceptionNameCoding

putCharArray

public void putCharArray(char[] val)
                  throws PExceptionNameCoding
Specified by:
putCharArray in interface PNCStringCoder
PExceptionNameCoding

getStringCode

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