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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicStringCoder
public BasicStringCoder()
BasicStringCoder
public BasicStringCoder(java.lang.String en)
getByte
public byte getByte()
throws PExceptionCoder
- Specified by:
getByte
in interface PNCStringCoder
PExceptionCoder
getObyte
public java.lang.Byte getObyte()
throws PExceptionCoder
- Specified by:
getObyte
in interface PNCStringCoder
PExceptionCoder
getChar
public char getChar()
throws PExceptionCoder
- Specified by:
getChar
in interface PNCStringCoder
PExceptionCoder
getOchar
public java.lang.Character getOchar()
throws PExceptionCoder
- Specified by:
getOchar
in interface PNCStringCoder
PExceptionCoder
getShort
public short getShort()
throws PExceptionCoder
- Specified by:
getShort
in interface PNCStringCoder
PExceptionCoder
getOshort
public java.lang.Short getOshort()
throws PExceptionCoder
- Specified by:
getOshort
in interface PNCStringCoder
PExceptionCoder
getInt
public int getInt()
throws PExceptionCoder
- Specified by:
getInt
in interface PNCStringCoder
PExceptionCoder
getOint
public java.lang.Integer getOint()
throws PExceptionCoder
- Specified by:
getOint
in interface PNCStringCoder
PExceptionCoder
getLong
public long getLong()
throws PExceptionCoder
- Specified by:
getLong
in interface PNCStringCoder
PExceptionCoder
getOlong
public java.lang.Long getOlong()
throws PExceptionCoder
- Specified by:
getOlong
in interface PNCStringCoder
PExceptionCoder
getString
public java.lang.String getString()
throws PExceptionCoder
- Specified by:
getString
in interface PNCStringCoder
PExceptionCoder
getDate
public java.util.Date getDate()
throws PExceptionCoder
- Specified by:
getDate
in interface PNCStringCoder
PExceptionCoder
getByteArray
public byte[] getByteArray()
throws PExceptionCoder
- Specified by:
getByteArray
in interface PNCStringCoder
PExceptionCoder
getCharArray
public char[] getCharArray()
throws PExceptionCoder
- Specified by:
getCharArray
in interface PNCStringCoder
PExceptionCoder
putByte
public void putByte(byte val)
throws PExceptionCoder
- Specified by:
putByte
in interface PNCStringCoder
PExceptionCoder
putObyte
public void putObyte(java.lang.Byte val)
throws PExceptionCoder
- Specified by:
putObyte
in interface PNCStringCoder
PExceptionCoder
putChar
public void putChar(char val)
throws PExceptionCoder
- Specified by:
putChar
in interface PNCStringCoder
PExceptionCoder
putOchar
public void putOchar(java.lang.Character val)
throws PExceptionCoder
- Specified by:
putOchar
in interface PNCStringCoder
PExceptionCoder
putShort
public void putShort(short val)
throws PExceptionCoder
- Specified by:
putShort
in interface PNCStringCoder
PExceptionCoder
putOshort
public void putOshort(java.lang.Short val)
throws PExceptionCoder
- Specified by:
putOshort
in interface PNCStringCoder
PExceptionCoder
putInt
public void putInt(int val)
throws PExceptionCoder
- Specified by:
putInt
in interface PNCStringCoder
PExceptionCoder
putOint
public void putOint(java.lang.Integer val)
throws PExceptionCoder
- Specified by:
putOint
in interface PNCStringCoder
PExceptionCoder
putLong
public void putLong(long val)
throws PExceptionCoder
- Specified by:
putLong
in interface PNCStringCoder
PExceptionCoder
putOlong
public void putOlong(java.lang.Long val)
throws PExceptionCoder
- Specified by:
putOlong
in interface PNCStringCoder
PExceptionCoder
putString
public void putString(java.lang.String val)
throws PExceptionCoder
- Specified by:
putString
in interface PNCStringCoder
PExceptionCoder
putDate
public void putDate(java.util.Date val)
throws PExceptionCoder
- Specified by:
putDate
in interface PNCStringCoder
PExceptionCoder
putByteArray
public void putByteArray(byte[] va)
throws PExceptionCoder
- Specified by:
putByteArray
in interface PNCStringCoder
PExceptionCoder
putCharArray
public void putCharArray(char[] val)
throws PExceptionCoder
- Specified by:
putCharArray
in interface PNCStringCoder
PExceptionCoder
getStringCode
public java.lang.String getStringCode()
throws PExceptionCoder
- Specified by:
getStringCode
in interface PNCStringCoder
PExceptionCoder