Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hsqldb
Class TextDatabaseRowInput  view TextDatabaseRowInput download TextDatabaseRowInput.java

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byjava.io.DataInputStream
              extended byorg.hsqldb.DatabaseRowInput
                  extended byorg.hsqldb.TextDatabaseRowInput
All Implemented Interfaces:
java.io.Closeable, DatabaseRowInputInterface, java.io.DataInput
Direct Known Subclasses:
QuotedTextDatabaseRowInput

class TextDatabaseRowInput
extends DatabaseRowInput
implements DatabaseRowInputInterface

Class for reading the data for a database row in text table format.

Version:
1.7.0

Field Summary
protected  boolean emptyIsNull
           
protected  int field
           
private  java.lang.String fieldSep
           
private  boolean fieldSepEnd
           
private  int fieldSepLen
           
protected  int line
           
private  java.lang.String longvarSep
           
private  boolean longvarSepEnd
           
private  int longvarSepLen
           
protected  boolean makeSystemId
           
protected  int next
           
protected  int nextPos
           
(package private) static int NO_POS
           
protected  int pos
           
protected  int size
           
protected  java.lang.String text
           
private  int textLen
           
private  java.lang.String varSep
           
private  boolean varSepEnd
           
private  int varSepLen
           
 
Fields inherited from class java.io.DataInputStream
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
TextDatabaseRowInput(java.lang.String fieldSep, java.lang.String varSep, java.lang.String longvarSep, boolean emptyIsNull)
          fredt@users - comment - in future may use a custom subclasse of InputStream to read the data.
 
Method Summary
 int available()
          Calls the in.available() method.
protected  boolean checkNull()
           
protected  java.lang.String getField(java.lang.String sep, int sepLen, boolean isEnd)
           
 int getNextPos()
           
 int getPos()
           
 int getSize()
           
protected  java.lang.Long readBigint()
           
protected  byte[] readBinary(int type)
           
protected  java.lang.Boolean readBit()
           
private  byte[] readByteArray(java.lang.String field)
           
protected  java.lang.String readChar(int type)
           
 java.lang.Object[] readData(int[] colTypes)
          reads row data from a stream using the JDBC types in colTypes
protected  java.sql.Date readDate()
           
protected  java.math.BigDecimal readDecimal()
           
 int readIntData()
           
protected  java.lang.Integer readInteger()
           
private  java.lang.String readLongVarString()
           
protected  java.lang.Object readOther()
           
protected  java.lang.Double readReal(int type)
           
protected  java.lang.Integer readSmallint()
           
 java.lang.String readString()
           
protected  java.sql.Time readTime()
           
protected  java.sql.Timestamp readTimestamp()
           
 int readType()
           
private  java.lang.String readVarString()
           
 void reset()
          Calls the in.reset() method.
 void setNextPos(int pos)
           
 void setSource(java.lang.String text, int pos)
           
 void skippedLine()
           
 
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
 
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldSep

private java.lang.String fieldSep

varSep

private java.lang.String varSep

longvarSep

private java.lang.String longvarSep

fieldSepLen

private int fieldSepLen

varSepLen

private int varSepLen

longvarSepLen

private int longvarSepLen

fieldSepEnd

private boolean fieldSepEnd

varSepEnd

private boolean varSepEnd

longvarSepEnd

private boolean longvarSepEnd

textLen

private int textLen

text

protected java.lang.String text

line

protected int line

field

protected int field

next

protected int next

emptyIsNull

protected boolean emptyIsNull

NO_POS

static final int NO_POS
See Also:
Constant Field Values

pos

protected int pos

nextPos

protected int nextPos

size

protected int size

makeSystemId

protected boolean makeSystemId
Constructor Detail

TextDatabaseRowInput

public TextDatabaseRowInput(java.lang.String fieldSep,
                            java.lang.String varSep,
                            java.lang.String longvarSep,
                            boolean emptyIsNull)
                     throws java.io.IOException
fredt@users - comment - in future may use a custom subclasse of InputStream to read the data.

Method Detail

setSource

public void setSource(java.lang.String text,
                      int pos)

getField

protected java.lang.String getField(java.lang.String sep,
                                    int sepLen,
                                    boolean isEnd)
                             throws java.io.IOException

readString

public java.lang.String readString()
                            throws java.io.IOException
Specified by:
readString in interface DatabaseRowInputInterface
Specified by:
readString in class DatabaseRowInput

readVarString

private java.lang.String readVarString()
                                throws java.io.IOException

readLongVarString

private java.lang.String readLongVarString()
                                    throws java.io.IOException

readByteArray

private byte[] readByteArray(java.lang.String field)
                      throws java.io.IOException,
                             java.sql.SQLException

readIntData

public int readIntData()
                throws java.io.IOException
Specified by:
readIntData in interface DatabaseRowInputInterface
Specified by:
readIntData in class DatabaseRowInput

readType

public int readType()
             throws java.io.IOException
Specified by:
readType in interface DatabaseRowInputInterface
Specified by:
readType in class DatabaseRowInput

checkNull

protected boolean checkNull()
Specified by:
checkNull in class DatabaseRowInput

readChar

protected java.lang.String readChar(int type)
                             throws java.io.IOException
Specified by:
readChar in class DatabaseRowInput

readSmallint

protected java.lang.Integer readSmallint()
                                  throws java.io.IOException,
                                         java.sql.SQLException
Specified by:
readSmallint in class DatabaseRowInput

readInteger

protected java.lang.Integer readInteger()
                                 throws java.io.IOException,
                                        java.sql.SQLException
Specified by:
readInteger in class DatabaseRowInput

readBigint

protected java.lang.Long readBigint()
                             throws java.io.IOException,
                                    java.sql.SQLException
Specified by:
readBigint in class DatabaseRowInput

readReal

protected java.lang.Double readReal(int type)
                             throws java.io.IOException,
                                    java.sql.SQLException
Specified by:
readReal in class DatabaseRowInput

readDecimal

protected java.math.BigDecimal readDecimal()
                                    throws java.io.IOException,
                                           java.sql.SQLException
Specified by:
readDecimal in class DatabaseRowInput

readTime

protected java.sql.Time readTime()
                          throws java.io.IOException,
                                 java.sql.SQLException
Specified by:
readTime in class DatabaseRowInput

readDate

protected java.sql.Date readDate()
                          throws java.io.IOException,
                                 java.sql.SQLException
Specified by:
readDate in class DatabaseRowInput

readTimestamp

protected java.sql.Timestamp readTimestamp()
                                    throws java.io.IOException,
                                           java.sql.SQLException
Specified by:
readTimestamp in class DatabaseRowInput

readBit

protected java.lang.Boolean readBit()
                             throws java.io.IOException,
                                    java.sql.SQLException
Specified by:
readBit in class DatabaseRowInput

readOther

protected java.lang.Object readOther()
                              throws java.io.IOException,
                                     java.sql.SQLException
Specified by:
readOther in class DatabaseRowInput

readBinary

protected byte[] readBinary(int type)
                     throws java.io.IOException,
                            java.sql.SQLException
Specified by:
readBinary in class DatabaseRowInput

setNextPos

public void setNextPos(int pos)

skippedLine

public void skippedLine()

reset

public void reset()
Description copied from class: java.io.FilterInputStream
Calls the in.reset() method.


getPos

public int getPos()
           throws java.io.IOException

getNextPos

public int getNextPos()
               throws java.io.IOException

getSize

public int getSize()

available

public int available()
              throws java.io.IOException

readData

public java.lang.Object[] readData(int[] colTypes)
                            throws java.io.IOException,
                                   java.sql.SQLException