Copyright © Rasmus Sten and contributors, 1997-2004

nu.dll.lyskom
Class Hollerith

java.lang.Object
  |
  +--nu.dll.lyskom.KomToken
        |
        +--nu.dll.lyskom.Hollerith
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
HollerithStream, Text

public class Hollerith
extends KomToken
implements java.io.Serializable

Class representing the LysKOM datatype Hollerith. A Hollerith represents a byte vector of arbitrary length containing arbitrary byte values. It is used for all handling of strings in LysKOM.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class nu.dll.lyskom.KomToken
ARRAY, COMPL, HOLLERITH, PRIMITIVE
 
Constructor Summary
Hollerith()
          Constructs an empty Hollerith
Hollerith(byte[] b)
          Constructs a Hollerith containing the supplied bytes
Hollerith(byte[] buf, java.lang.String charset)
           
Hollerith(java.lang.String s)
           
Hollerith(java.lang.String s, java.lang.String charset)
          Construct a Hollertith by converting the supplied string into bytes according to the given charset.
 
Method Summary
 java.lang.String getContentString()
          Returns this Holleriths contents as a String, translated according to the server's encoding.
 byte[] toNetwork()
          Constructs a byte-array representation of this Hollerith suitable for sending to the server, over the network (into the sea...).
 java.lang.String toString()
           
 
Methods inherited from class nu.dll.lyskom.KomToken
equals, getContents, getType, intValue, isEol, setContents, toInt, toInteger
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Hollerith

public Hollerith()
Constructs an empty Hollerith


Hollerith

public Hollerith(java.lang.String s)

Hollerith

public Hollerith(byte[] buf,
                 java.lang.String charset)

Hollerith

public Hollerith(java.lang.String s,
                 java.lang.String charset)
Construct a Hollertith by converting the supplied string into bytes according to the given charset.


Hollerith

public Hollerith(byte[] b)
Constructs a Hollerith containing the supplied bytes

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class KomToken

getContentString

public java.lang.String getContentString()
Returns this Holleriths contents as a String, translated according to the server's encoding.


toNetwork

public byte[] toNetwork()
Constructs a byte-array representation of this Hollerith suitable for sending to the server, over the network (into the sea...).
A Hollerith is a prefix being the string length and the characted 'H', followed by the string data.

Overrides:
toNetwork in class KomToken

Copyright © Rasmus Sten and contributors, 1997-2004