|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTSFile
class TSFile
.
====================================================================== Class TSFile -- Compress, decompress, reduce or expand of a file Reduce - change normal format to tokenized version [UT]->[UB] Expand - change tokenized format to normal version [UB]->[UT] Compress - use zlib-algorithm to compress tokenized format Uncompress - uncompress data to tokenized format [CB]->[UB] Uncompress/Expand is done step by step while reading data Reduce is done step by step while writing data (Write data to file is executed before file is closed) Compress is executed before file is closed ##TSFile (Eyecatcher) ======================================================================
Field Summary | |
---|---|
private TSByteArrIO |
BIO
|
private TSBuf |
cB
|
private TSFleStack |
cItS
|
private int |
cMde
|
private int |
cP
|
private int |
cRep
|
private static java.text.DecimalFormat[] |
dF
|
private static java.text.DecimalFormat |
DF2
|
private java.lang.StringBuilder |
DtaB
|
private java.util.ArrayList<java.lang.String> |
DtaI
|
private java.lang.String |
DtaO
|
private java.lang.String |
EMsg
|
private static float[] |
F
|
private static java.text.DecimalFormatSymbols |
fFS
|
private static java.lang.String[] |
FL1
|
private static java.lang.String[] |
FL2
|
private java.io.File |
Fle
|
private static byte[] |
FlePfx
|
private java.lang.String |
FNme
|
protected static int |
IA
|
protected static int |
ICB
|
protected static int |
ICT
|
protected static java.lang.String |
IdStr
|
protected static int |
IN
|
private static int |
IO_app
|
private static int |
IO_bin
|
private static int |
IO_bio
|
private static int |
IO_cpr
|
private static int |
IO_Msk
|
private static int |
IO_out
|
private static int |
IO_rqf
|
private java.io.InputStream |
IS
|
private java.util.Stack<TSFleStack> |
ItS
|
protected static int |
IU
|
protected static int |
IUB
|
protected static int |
IUT
|
private static int |
MaxLen
|
private static java.lang.String |
Mkr0
|
private static java.lang.String |
Mkr1
|
private int |
mode
|
protected static int |
OA
|
protected static int |
OAA
|
protected static int |
OB_Len
|
protected static int |
OCB
|
protected static int |
OCT
|
private java.io.OutputStream |
OS
|
private static int |
OSize
|
protected static int |
OU
|
protected static int |
OUA
|
protected static int |
OUB
|
protected static int |
OUT
|
private int |
Pos
|
private int |
rc
|
private java.io.BufferedReader |
Rdr
|
private int |
rl
|
private static java.text.DecimalFormat[] |
sF
|
protected static TSFleTok |
tok1
|
private java.io.BufferedWriter |
Wtr
|
private static java.text.DecimalFormat[] |
xF
|
Constructor Summary | |
---|---|
protected |
TSFile()
. |
protected |
TSFile(java.io.File dat)
. |
Method Summary | |
---|---|
protected TSBuf |
chgBuf(TSBuf nB)
. |
protected java.lang.String |
chkFKng(java.lang.String s,
boolean t)
. |
protected java.lang.String |
close()
. |
private boolean |
Expand()
. |
protected java.lang.String |
getData()
. |
protected java.lang.String |
getErr()
. |
private java.lang.String |
getFloat(int c)
. |
private java.lang.String |
getFloat$(int rep,
int rd)
. |
private java.lang.String |
getHex$(int rep,
int len,
boolean up)
. |
private long |
getInt(int len)
. |
private java.lang.String |
getInt$(int rep)
. |
private java.lang.String |
getItem(java.lang.String rv)
. |
protected int |
getMode(int md)
. |
protected java.lang.String |
getPath()
. |
private java.lang.String |
getPrfx(boolean ext)
. |
protected int |
getStat(boolean c)
. |
private java.lang.String |
getString(int len)
. |
private java.lang.String |
getString$(boolean add)
. |
protected TSFleTok |
getTok(int i)
. |
protected TSFleTok |
getTok(java.lang.String s)
. |
protected int |
getTyp()
. |
private java.lang.String |
getUInt$(int rep)
. |
protected java.lang.String |
open(int iom)
. |
protected java.lang.String |
prtMode()
. |
protected java.lang.String |
putData(java.lang.String dta)
. |
protected boolean |
Reduce(java.lang.String lne)
. |
protected boolean |
setBuffer(TSByteArrIO cIO)
. |
protected java.lang.String |
setTyp(int id)
. |
private java.lang.String |
skpLne(java.lang.String cB,
boolean noI)
. |
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 |
---|
protected static final java.lang.String IdStr
protected static int OB_Len
private static final int OSize
private static final int MaxLen
private static final java.text.DecimalFormatSymbols fFS
private static final java.text.DecimalFormat DF2
private static final java.text.DecimalFormat[] dF
private static final java.text.DecimalFormat[] xF
private static final java.text.DecimalFormat[] sF
private static final float[] F
private static final byte[] FlePfx
private static final java.lang.String[] FL1
private static final java.lang.String[] FL2
private static final java.lang.String Mkr0
private static final java.lang.String Mkr1
protected static final TSFleTok tok1
protected static final int IN
protected static final int IUT
protected static final int IUB
protected static final int ICT
protected static final int ICB
protected static final int OUT
protected static final int OUB
protected static final int OCT
protected static final int OCB
protected static final int IU
protected static final int IA
protected static final int OU
protected static final int OA
protected static final int OUA
protected static final int OAA
private static final int IO_rqf
private static final int IO_bio
private static final int IO_out
private static final int IO_app
private static final int IO_cpr
private static final int IO_bin
private static final int IO_Msk
private java.io.File Fle
private int cMde
private int mode
private java.lang.String FNme
private java.lang.String EMsg
private java.io.BufferedReader Rdr
private java.io.BufferedWriter Wtr
private java.io.InputStream IS
private java.io.OutputStream OS
private TSByteArrIO BIO
private int Pos
private int cP
private java.util.Stack<TSFleStack> ItS
private TSFleStack cItS
private java.util.ArrayList<java.lang.String> DtaI
private java.lang.String DtaO
private java.lang.StringBuilder DtaB
private TSBuf cB
private int cRep
private int rc
private int rl
Constructor Detail |
---|
protected TSFile()
===================================================================== Constructor: (1) Create Default-Entry =====================================================================
protected TSFile(java.io.File dat)
===================================================================== Constructor: (2) Create Standard-Entry =====================================================================
Method Detail |
---|
protected final TSBuf chgBuf(TSBuf nB)
===================================================================== Method "chgBuf" Modify or read current inputbuffer-reference This field/method is NOT used by TSFile. Applications may use this field to support methods with its current input-buffer ##chgBuf.TSFile (Eyecatcher) =====================================================================
protected java.lang.String chkFKng(java.lang.String s, boolean t)
===================================================================== Method "chkFKng" (Dummy for extended classes) Check File-Identifier for current type of file First Argument (String): null - provide full key for write returns 'null' if key not available due to error(s) else returns the requested file-id <>null - check provided file-id returns 'null' if the check succeeds else returns an error-message (result <> null) Form of file-id must be of the type specified with the second argument. If this type is not supported an error is returned in every case. THIS dummy-function returns an error in every case, because - normally - it is overwritten. ##chkFKng.TSFile (Eyecatcher) =====================================================================
protected java.lang.String close()
===================================================================== Method "close" Close reader/writer again Method returns error-message or 'null' ##close.TSFile (Eyecatcher) =====================================================================
private final boolean Expand()
===================================================================== Method "Expand" Process token-definitions and create lines of data. Attention: - Method is ONLY used when 'input' is active. - Binary file is completely loaded into memory. - 'cP' is (mis)used as 'current-shift-level', which differs from value 'ItS.size()'. ##Expand.TSFile (Eyecatcher) =====================================================================
protected final java.lang.String getData()
===================================================================== Method "getData" Read next line Next line is provided from file or buffer If buffer is empty is is filled with decompressed data from file if an error is found: EMsg is set and 'null' is returned ##getData.TSFile (Eyecatcher) =====================================================================
protected final java.lang.String getErr()
===================================================================== Method "getErr" Get active error-message ('null' if none) ##getErr.TSFile (Eyecatcher) =====================================================================
private final java.lang.String getFloat(int c)
===================================================================== Method "getFloat" Get 4 Byte from file, use as FLOAT and convert them to STRING ##getFloat.TSFile (Eyecatcher) =====================================================================
private final java.lang.String getFloat$(int rep, int rd)
===================================================================== Method "getFloat$" Get 'rep' x float-value from file using 'getFloat()' ##getFloat$.TSFile (Eyecatcher) =====================================================================
private final java.lang.String getHex$(int rep, int len, boolean up)
===================================================================== Method "getHex$" Get 'rep' x UINT from file and convert to 'hexadecimal'-String ##getHex$.TSFile (Eyecatcher) =====================================================================
private final long getInt(int len)
===================================================================== Method "getInt" Get 'Integer'/'Unsigned Integer' ('len' Byte) from buffer as 'long'. Method uses current inputbuffer and increments position-pointer. ##getInt.TSFile (Eyecatcher) =====================================================================
private final java.lang.String getInt$(int rep)
===================================================================== Method "getInt$" Get 'rep' x int-value from file using 'getInt()' Convert SIGNED values to String and concatenate them (separated with ' ') ##getInt$.TSFile (Eyecatcher) =====================================================================
private final java.lang.String getItem(java.lang.String rv)
===================================================================== Method "getItem" Extract next item and provide it in String-format. Surrrounding quotes are deleted if present. If no item is found, 'null' is returned. Method operates on 'DtaO' and uses pointer 'cP' (compare to 'remark' within method 'reduce'). If 'empty remaining string' is found, 'Mkr0' is returned. If string-fragment was successfully stored, 'Mkr0' is returned. If a valid 'empty string' is found, 'Mkr1' is returned. Testing for 'special values' is possible! (rv!=null) In this case 'null' is returned if match is found and the found original values otherwise. ATTENTION: '(' and')' is a valid seperator. So, these chars can only be skipped using 'request special value'. Attention: This method uses global 'Reduce'-buffer 'DtaB' to support input-records which are split among more than one line. ##getItem.TSFile (Eyecatcher) =====================================================================
protected final int getMode(int md)
===================================================================== Method "getMode" Provides caller with last used I/O-mode, modified as requested. Attention: I/O-Mode is masked to reflect binary/compress ONLY. ##getMode.TSFile (Eyecatcher) =====================================================================
protected final java.lang.String getPath()
===================================================================== Method "getPath" Returns current (complete / fully-qualified) filename as stored. ##getPath.TSFile (Eyecatcher) =====================================================================
private final java.lang.String getPrfx(boolean ext)
===================================================================== Methode "getPrfx" Returns a prefix-definition of an output-line as String using iteration-counter as basis. This method uses the current shift-level as basis. 'cP' is (mis)used as 'current-shift-level', which differs from value 'ItS.size()'. ##getPrfx.TSFile (Eyecatcher) =====================================================================
protected final int getStat(boolean c)
===================================================================== Method "getStat" Get statistic-values of current I/O Attention: values are valid even if file is already closed values are initialized when file is opened (again) ##getStat.TSFile (Eyecatcher) =====================================================================
private final java.lang.String getString(int len)
===================================================================== Method "getString" Read Unicode-String from binary file. ATTENTION: + No additional Blank is added. + If input-data is not fully available, up to 5 retries are scheduled. + Data may be read from 'file' or 'IO-buffer' (due to IS). + Position-pointer 'Pos' is adjusted. ##getString.TSFile (Eyecatcher) =====================================================================
private final java.lang.String getString$(boolean add)
===================================================================== Method "getString$" Get one String-definition and surround it with quotes if needed or requested. ##getString$.TSFile (Eyecatcher) =====================================================================
protected TSFleTok getTok(int i)
===================================================================== Method "getTok" (Dummy for extended classes) Provide requested token due to token-number. This dummy-version, which should be overwritten, returns an error. ##getTok.TSFile (Eyecatcher) =====================================================================
protected TSFleTok getTok(java.lang.String s)
===================================================================== Method "getTok" (Dummy for extended classes) Provide requested token due to token-name. This dummy-version, which should be overwritten, returns an error. ##getTok.TSFile (Eyecatcher) =====================================================================
protected int getTyp()
===================================================================== Method "getTyp" (Dummy for extended classes). Provides current identifier-type (if available). This dummy-version, which should be overwritten, returns a default-value (0). ##getTyp.TSFile (Eyecatcher) =====================================================================
private final java.lang.String getUInt$(int rep)
===================================================================== Method "getUInt$" Get 'rep' x unsigned int-value from file using 'getInt()' Convert unsigned values to String and concatenate them ##getUInt$.TSFile (Eyecatcher) =====================================================================
protected java.lang.String open(int iom)
===================================================================== Method "open" Open file and create Reader or Writer If 'Input' is requested (or special option): check input-mode of file (in this case 'iom'-argument is modified) All modes/formats are supported for 'input'! The following I/O-ID's are used: IN = 0(00) Input, unknown format IUT = 128(80) Input, UT-Format (format is requested) IUB = 129(81) Input, UB-Format (format is requested) ICT = 130(82) Input, CT-Format (format is requested) ICB = 131(83) Input, CB-Format (format is requested) OUT = 8(08) Output, UT-Format OUB = 9(09) Output, UB-Format OCT = 10(0A) Output, CT-Format OCB = 11(0B) Output, CB-Format IU = 16(10) Input, unicode IA = 17(11) Input, ascii OU = 24(18) Output, unicode OA = 25(19) Output, ascii OUA = 28(1C) Output, unicode,append OAA = 29(1D) Output, ascii,append This includes the following flags: IO_bin = x01 ASCII(=Binary) (else: Unicode=Text) IO_cpr = x02 Compress IO_app = x04 Append (if 'buffered-I/O') IO_out = x08 Output IO_bio = x10 Buffered-IO (no File-ID) IO_rqf = x80 format requested with input and masks: IO_Msk = x03 mask file-format from IO-command Method returns an error-message or 'null' if no error Attention: ALL Parameters are checked in any case! If 'binary input' is requested the COMPLETE file is also loaded into memory. Buffer-methods must then be used to access the data. ##open.TSFile (Eyecatcher) =====================================================================
protected final java.lang.String prtMode()
===================================================================== Method "prtMode" Return format of file according to current IO-mode. ##prtMde.TSFile (Eyecatcher) =====================================================================
protected final java.lang.String putData(java.lang.String dta)
===================================================================== Method "putData" Write line to file Do Compress and/or Reduce if requested Method returns error-message or 'null' if no error ##putData.TSFile (Eyecatcher) =====================================================================
protected final boolean Reduce(java.lang.String lne)
===================================================================== Method "Reduce" Reduce Data-Definition to token-format. Attention: - Method is ONLY used when 'output' is active. - Variable 'cP' is also used for inpt with different meaning. ##Reduce.TSFile (Eyecatcher) =====================================================================
protected final boolean setBuffer(TSByteArrIO cIO)
===================================================================== Method "setBuffer" Replace current (binary) IO-Buffer with external one. Remark: This method is ONLY successful, if the file is NOT already opened. ##setBuffer.TSFile (Eyecatcher) =====================================================================
protected java.lang.String setTyp(int id)
===================================================================== Method "setTyp" (Dummy for extended classes). Activate an identifier-type for writing. This dummy-version, which should be overwritten, returns an error. ##setTyp.TSFile (Eyecatcher) =====================================================================
private final java.lang.String skpLne(java.lang.String cB, boolean noI)
===================================================================== Methode "skpLne" Save the current buffer to the inputqueue and provides a new buffer which is correctly initialized. ##getPrfx.TSFile (Eyecatcher) =====================================================================
protected java.lang.String toStr()
===================================================================== Method "toStr" Build a string-representation of all values of this class ##toStr.TSFile (Eyecatcher) =====================================================================
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |