Class TSFleTok

java.lang.Object
  extended by TSFleTok
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TSFleStack

 class TSFleTok
extends java.lang.Object
implements java.io.Serializable

.

======================================================================
 Class TSFleTok -- Definition of a file-token-pattern.
 TSFleTok-definition are used to code or decode token of various
   files.

 A token, as it is used within the data-files, consist of:
   - a token-ID (unsigned int(4-LittleEndian))
   - a length-field (unsigned int(4-LE))
   - a label-length-field (unsigned byte)
   - an optional label (unicode-string) if label-length > 0
   - various number of token-items (including complete other token)
       until length is exhausted

 Each token contains a list of 'type-definitions', which selects
   the datatype, which is expected to be used. So every sequence
   of data-items can be defined. Such a data-item can be:
    + UInt   - an unsigned integer-value
    + SInt   - a signed integer-value
    + String - a string of any length (0..65535)
    + Hex    - an unsigned integer-value expressed as a hexadecimal
    + Float  - a floatingpoint-value of single precision
    + Byte   - a signed byte-value with decimal format
    + Time   - a unsigned integer which specifies a time-value
    + Loop   - an item to control 'virtual token' (see down)

   Float- and Hex-values can be formatted to different
   sizes/precisions. However, 4 bytes are used to store them.
 A 'type-definitions' also contains some options, which define the
   relationship between such definitons. It also states, if such
   a type is 'optional' and can be omitted.
 Data-items of the same type can be grouped together within a
   single 'type-definition'. Then, the 'Repeat-value' is set to a
   value greater than '1'. Even the feature 'until end' can be
   expressed by using '0' as the repeat-value. If this feature is
   used, the data-item must be the last one within the itemlist.
 If a 'type-definition' is marked as 'optional', the 'Repeat-value'
   changes to a 'Precondition'. This condition defines the minimum
   number of items that must follow, so that the current optional
   item can be present.
   Attention: An optional entry with a precondition of '0' is processed
              as a 'until-end'-definition (normally NOT optional) which
              DOES NOT require an existend item.
 A token also contains some attributes, which describe the
   relationship to other token. Such an attribute marks the token as
   a 'comment'-token, which changes the way how items are parsed.
   (Until now, this is the only attribute.)

 A token may also be a 'Virtual Token', which is a set/group of
   type-definitions which are NEITHER surrounded by brackets nor
   prefixed by a tokenname and / or label.
   Together with a 'Loop'-item, it is possible to define a repeated
   set of different type-definitions.
   A 'Virtual Token' is marked by a negative key-number and is ONLY
   included in the 'decompress'-list of the tokens.
   Attention: A 'virtual token' MUST NOT contain features like
              'until end' because these features prevend the token
              from terminating after a fixed number of steps. Then,
              the surrounding token never becomes active again.
 ##TSFleTok (Eyecatcher)
======================================================================
 


Field Summary
private  boolean Cmt
           
private  int Id
           
static java.lang.String IdStr
           
private  java.lang.String Name
           
private  char[] TypS
           
 
Constructor Summary
protected TSFleTok()
          .
protected TSFleTok(int id, java.lang.String nme, boolean cmt, char... td)
          .
protected TSFleTok(int id, java.lang.String nme, char... td)
          .
protected TSFleTok(TSFleTok cT)
          .
 
Method Summary
protected  java.lang.Integer getKey()
          .
protected  java.lang.String getName()
          .
protected  int getTyp(int ix)
          .
protected  boolean isCmt()
          .
protected  boolean isVT()
          .
protected  java.lang.String toStr()
          .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IdStr

public static final java.lang.String IdStr
See Also:
Constant Field Values

Id

private final int Id

Cmt

private final boolean Cmt

Name

private final java.lang.String Name

TypS

private final char[] TypS
Constructor Detail

TSFleTok

protected TSFleTok()
.
=====================================================================
 Constructor: (1) Create Default-Entry
=====================================================================
  


TSFleTok

protected TSFleTok(int id,
                   java.lang.String nme,
                   boolean cmt,
                   char... td)
.
=====================================================================
 Constructor: (2) Create Basic-Entry (complete)
=====================================================================
  


TSFleTok

protected TSFleTok(int id,
                   java.lang.String nme,
                   char... td)
.
=====================================================================
 Constructor: (3) Create Extended-Entry (option default to 'false')
=====================================================================
  


TSFleTok

protected TSFleTok(TSFleTok cT)
.
=====================================================================
 Constructor: (4) Create entry from template
=====================================================================
  

Method Detail

getKey

protected final java.lang.Integer getKey()
.
=====================================================================
 Method "getKey"
 Provide current key as Integer-Object.
 (Method is also used for initialization)
 ##getKey.TSFleTok (Eyecatcher)
=====================================================================
  


getName

protected final java.lang.String getName()
.
=====================================================================
 Method "getName"
 Answer request for current name of token.
 (Method is also used for initialization)
 ##getName.TSFleTok (Eyecatcher)
=====================================================================
  


getTyp

protected final int getTyp(int ix)
.
=====================================================================
 Method "getTyp"
 Provide current/new type-definition from list.
 ##getTyp..TSFleTok (Eyecatcher)
=====================================================================
  


isCmt

protected final boolean isCmt()
.
=====================================================================
 Method "isCmt"
 Returns Info if Token describes a 'Comment'.
 ##isCmt.TSFleTok (Eyecatcher)
=====================================================================
  


isVT

protected final boolean isVT()
.
=====================================================================
 Method "isVT"
 Returns Info if definition is a 'Virtual Token'.
 A'virtual token' is a set of type-definitions, which are NEITHER
  surrounded by brackets nor prefixed by a tokenname and / or label.
 A'virtual token' is marked by a negative key.
 ##isVT.TSFleTok (Eyecatcher)
=====================================================================
  


toStr

protected java.lang.String toStr()
.
=====================================================================
 Method "toStr"
 Build a string-representation of all values of this class
 ##toStr.TSFleTok (Eyecatcher)
=====================================================================