com.timeindexing.io
Class IndexTyper

java.lang.Object
  extended bycom.timeindexing.io.IndexTyper

public class IndexTyper
extends java.lang.Object

This opens an Index file and determines what type of of index is represented.


Constructor Summary
protected IndexTyper()
          Construct a typer
  IndexTyper(java.io.File file)
          Construct a decoder.
  IndexTyper(java.lang.String filename)
          Construct a decoder.
 
Method Summary
 long close()
          Operation on close
 boolean exists(java.lang.String filename)
          Does the index header file exist
protected  long getHeaderLength()
          Determine the length of a Header
 ID getID()
          Get an ID of an index.
 IndexType getIndexType()
          Get the data style.
 java.lang.String getName()
          Get the name of the index.
 java.lang.String getPathName()
          Get the path name.
 boolean isOpen()
          Is the IndexHeader open
 boolean open(java.lang.String filename)
          Open an index header to read it.
 boolean open(java.lang.String filename, java.lang.String extention)
          Open an index header to read it.
 long read()
          Read an index header from the header stream.
 long readFromChannel(java.nio.channels.FileChannel channel, long headerSize)
          Read an index header from the header stream.
 void setID(ID id)
          Set the ID of the index.
 void setIndexType(IndexType type)
          Set the data style.
 void setName(java.lang.String name)
          Set the name of the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexTyper

protected IndexTyper()
Construct a typer


IndexTyper

public IndexTyper(java.lang.String filename)
           throws java.io.IOException
Construct a decoder.


IndexTyper

public IndexTyper(java.io.File file)
           throws java.io.IOException
Construct a decoder.

Method Detail

getPathName

public java.lang.String getPathName()
Get the path name.


open

public boolean open(java.lang.String filename)
             throws java.io.IOException
Open an index header to read it.

Throws:
java.io.IOException

open

public boolean open(java.lang.String filename,
                    java.lang.String extention)
             throws java.io.IOException
Open an index header to read it.

Throws:
java.io.IOException

exists

public boolean exists(java.lang.String filename)
Does the index header file exist


isOpen

public boolean isOpen()
Is the IndexHeader open


close

public long close()
           throws java.io.IOException
Operation on close

Throws:
java.io.IOException

read

public long read()
          throws java.io.IOException
Read an index header from the header stream.

Throws:
java.io.IOException

readFromChannel

public long readFromChannel(java.nio.channels.FileChannel channel,
                            long headerSize)
                     throws java.io.IOException
Read an index header from the header stream.

Throws:
java.io.IOException

getName

public java.lang.String getName()
Get the name of the index.


setName

public void setName(java.lang.String name)
Set the name of the index.


getID

public ID getID()
Get an ID of an index.


setID

public void setID(ID id)
Set the ID of the index.


getIndexType

public IndexType getIndexType()
Get the data style. Either inline or external or shadow.


setIndexType

public void setIndexType(IndexType type)
Set the data style. Either inline or external or shadow.


getHeaderLength

protected long getHeaderLength()
                        throws java.io.IOException
Determine the length of a Header

Throws:
java.io.IOException