ru.smartflex.tools.dbf
Class DbfHeader

java.lang.Object
  extended by ru.smartflex.tools.dbf.DbfHeader

public class DbfHeader
extends java.lang.Object

Contains dbf header definition.

Since:
1.00
Author:
galisha

Constructor Summary
protected DbfHeader()
           
protected DbfHeader(java.io.File dbfFile, java.lang.String enc, DbfIterator dbfIterator)
           
protected DbfHeader(java.io.InputStream is, java.lang.String enc, DbfIterator dbfIterator)
           
 
Method Summary
protected  void addColumn(DbfColumn dbfColumn)
           
 void closeDbfHeader()
          Closes dbf stream (and also iterator).
protected  java.lang.String getCodePage()
           
protected  DbfColumn getColumn(java.lang.String name)
           
 java.util.Iterator<DbfColumn> getColumnIterator()
          Returns dbf column iterator.
 int getCountColumns()
          Returns count of column.
 int getCountRecords()
          Returns all amount of records with deleted rows.
protected  int getCurrentOffset()
           
 DbfIterator getDbfIterator()
          Returns iterator.
protected  java.io.InputStream getDbfStream()
           
protected  int getFirstRecordPosition()
           
protected  int getLengthRecord()
           
protected  java.util.List<DbfColumn> getOrderedColumnList()
           
protected  int getTypeDbf()
           
 boolean isColumnExisted(java.lang.String... columnNames)
          Checks entirely array of column names in dbf header.
 boolean isColumnExisted(java.lang.String columnName)
          Checks column name in dbf header.
 boolean isDbfHeaderValid()
          Validates dbf header
protected  void setCountRecords(int countRecords)
           
protected  void setCurrentOffset(int currentOffset)
           
protected  void setFirstRecordPosition(int firstRecordPosition)
           
protected  void setTypeDbf(int typeDbf)
           
 java.lang.String toString()
          To String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbfHeader

protected DbfHeader(java.io.File dbfFile,
                    java.lang.String enc,
                    DbfIterator dbfIterator)

DbfHeader

protected DbfHeader(java.io.InputStream is,
                    java.lang.String enc,
                    DbfIterator dbfIterator)

DbfHeader

protected DbfHeader()
Method Detail

getDbfIterator

public DbfIterator getDbfIterator()
Returns iterator.

Returns:
iterator.
Since:
1.05

closeDbfHeader

public void closeDbfHeader()
Closes dbf stream (and also iterator).

Since:
1.05
See Also:
DbfIterator.closeIterator()

isColumnExisted

public boolean isColumnExisted(java.lang.String columnName)
Checks column name in dbf header.

Parameters:
columnName -
Returns:
true if column is existed
Since:
1.05

isColumnExisted

public boolean isColumnExisted(java.lang.String... columnNames)
Checks entirely array of column names in dbf header.

Parameters:
columnNames -
Returns:
Since:
1.06

getOrderedColumnList

protected java.util.List<DbfColumn> getOrderedColumnList()

getColumnIterator

public java.util.Iterator<DbfColumn> getColumnIterator()
Returns dbf column iterator.

Returns:
dbf column iterator
Since:
1.05

addColumn

protected void addColumn(DbfColumn dbfColumn)

getColumn

protected DbfColumn getColumn(java.lang.String name)

getCurrentOffset

protected int getCurrentOffset()

setCurrentOffset

protected void setCurrentOffset(int currentOffset)

getFirstRecordPosition

protected int getFirstRecordPosition()

setFirstRecordPosition

protected void setFirstRecordPosition(int firstRecordPosition)

getCountRecords

public int getCountRecords()
Returns all amount of records with deleted rows.

Returns:
amount of records
Since:
1.05

setCountRecords

protected void setCountRecords(int countRecords)

getCodePage

protected java.lang.String getCodePage()

getTypeDbf

protected int getTypeDbf()

setTypeDbf

protected void setTypeDbf(int typeDbf)

getLengthRecord

protected int getLengthRecord()

getDbfStream

protected java.io.InputStream getDbfStream()

getCountColumns

public int getCountColumns()
Returns count of column.

Returns:
column count
Since:
1.05

toString

public java.lang.String toString()
To String.

Overrides:
toString in class java.lang.Object
Since:
1.05

isDbfHeaderValid

public boolean isDbfHeaderValid()
Validates dbf header

Returns:
true if header is ok
Since:
1.06