Copyright © Rasmus Sten and contributors, 1997-2004

nu.dll.lyskom
Class KomTokenArray

java.lang.Object
  |
  +--nu.dll.lyskom.KomToken
        |
        +--nu.dll.lyskom.KomTokenArray
All Implemented Interfaces:
java.io.Serializable

public class KomTokenArray
extends KomToken

Represents an array of KomToken objects. Each element in a KomTokenArray can consist of several KomToken objects.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class nu.dll.lyskom.KomToken
ARRAY, COMPL, HOLLERITH, PRIMITIVE
 
Constructor Summary
KomTokenArray(int length)
          Constructs an empty KomTokenArray
KomTokenArray(int length, int[] n)
          Constructs a KomTokenArray of the specified length, with the elements being the Strings converted into bytes according to KomToken(int)
KomTokenArray(int length, nu.dll.lyskom.KomToken[] o)
          Constructs a KomTokenArray containing the objects supplied.
KomTokenArray(int length, java.util.List tokenList)
          Creates a KomTokenArray of the supplied length out of each of the element in the List, which must contain only Tokenizable objects.
KomTokenArray(int length, java.lang.String[] s)
          Constructs a KomTokenArray of the specified length, with the elements being the Strings converted into bytes according to KomToken(String)
KomTokenArray(int length, nu.dll.lyskom.Tokenizable[] o)
          Creates a KomTokenArray of the supplied length using the supplied Tokenizable objects.
 
Method Summary
 int getLength()
          Returns the length of this array.
 nu.dll.lyskom.KomToken[] getTokens()
          Returns an array with all KomToken objects in this Array.
 int[] intValues()
          Returns an int array by converting all objects in this KomTokenArray into integers by calling their intValue() method.
static nu.dll.lyskom.KomToken[][] split(nu.dll.lyskom.KomTokenArray komarray)
          Static helper class that splits a two dimensional KomTokenArray into a two dimensional KomToken array (KomToken[][]), by dividing the number of objects by the length reported by the KomTokenArray.
 byte[] toNetwork()
          Converts this into a LysKOM ARRAY suitable for sending to the server, by calling each of the objects' toNetwork() method.
 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

KomTokenArray

public KomTokenArray(int length)
Constructs an empty KomTokenArray


KomTokenArray

public KomTokenArray(int length,
                     java.lang.String[] s)
Constructs a KomTokenArray of the specified length, with the elements being the Strings converted into bytes according to KomToken(String)

See Also:
KomToken.KomToken(String)

KomTokenArray

public KomTokenArray(int length,
                     int[] n)
Constructs a KomTokenArray of the specified length, with the elements being the Strings converted into bytes according to KomToken(int)

See Also:
KomToken.KomToken(int)

KomTokenArray

public KomTokenArray(int length,
                     nu.dll.lyskom.KomToken[] o)
Constructs a KomTokenArray containing the objects supplied.


KomTokenArray

public KomTokenArray(int length,
                     nu.dll.lyskom.Tokenizable[] o)
Creates a KomTokenArray of the supplied length using the supplied Tokenizable objects.


KomTokenArray

public KomTokenArray(int length,
                     java.util.List tokenList)
Creates a KomTokenArray of the supplied length out of each of the element in the List, which must contain only Tokenizable objects.

Method Detail

intValues

public int[] intValues()
Returns an int array by converting all objects in this KomTokenArray into integers by calling their intValue() method.

See Also:
KomToken.intValue()

split

public static nu.dll.lyskom.KomToken[][] split(nu.dll.lyskom.KomTokenArray komarray)
Static helper class that splits a two dimensional KomTokenArray into a two dimensional KomToken array (KomToken[][]), by dividing the number of objects by the length reported by the KomTokenArray.


getLength

public int getLength()
Returns the length of this array. Note that this does not have to be the same as the number of KomToken objects stored.


getTokens

public nu.dll.lyskom.KomToken[] getTokens()
Returns an array with all KomToken objects in this Array.


toString

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

toNetwork

public byte[] toNetwork()
Converts this into a LysKOM ARRAY suitable for sending to the server, by calling each of the objects' toNetwork() method.

Overrides:
toNetwork in class KomToken

Copyright © Rasmus Sten and contributors, 1997-2004