com.timeindexing.io
Class IndexDecoder

java.lang.Object
  extended bycom.timeindexing.index.DefaultIndexHeader
      extended bycom.timeindexing.io.IndexDecoder
All Implemented Interfaces:
ExtendedIndexHeader, IndexHeader, IndexHeaderReader, ManagedIndexHeader
Direct Known Subclasses:
IndexHeaderIO

public class IndexDecoder
extends DefaultIndexHeader
implements ManagedIndexHeader, IndexHeaderReader

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


Constructor Summary
protected IndexDecoder()
          Construct a decoder.
  IndexDecoder(java.io.File file)
          Construct a decoder.
  IndexDecoder(java.lang.String filename)
          Construct a decoder.
 
Method Summary
 long close()
          Operation on close
 java.lang.String getHeaderPathName()
          Get the header path name.
 boolean isOpen()
          Is the IndexHeader open
 boolean open()
          Open an index header to read it.
 boolean open(java.lang.String filename)
          Open an index header to read it.
protected  java.lang.Object processDataPath(HeaderOptionProcess what, java.nio.ByteBuffer readBuf)
          Process a data path
protected  java.lang.Object processDataType(HeaderOptionProcess what, java.nio.ByteBuffer readBuf)
          Process a data type
protected  java.lang.Object processDescription(HeaderOptionProcess what, java.nio.ByteBuffer readBuf)
          Process a description
protected  java.lang.Object processIndexPath(HeaderOptionProcess what, java.nio.ByteBuffer readBuf)
          Process a index path
protected  java.lang.Boolean processIsInTimeOrder(HeaderOptionProcess what, java.nio.ByteBuffer readBuf)
          Is the index in time order
protected  java.lang.Object processReferenceMapping(HeaderOptionProcess what, java.nio.ByteBuffer readBuf)
          Process the referenced indexes mapping
 long read()
          Read an index header from the header stream.
 
Methods inherited from class com.timeindexing.index.DefaultIndexHeader
addDataType, addIndexURI, getAllOptions, getAnnotationStyle, getDataPathName, getDataSize, getDataType, getDescription, getEndTime, getFirstDataTime, getFirstOffset, getFirstTime, getID, getIndexDataType, getIndexPathName, getIndexType, getIndexURI, getItemSize, getLastDataTime, getLastOffset, getLastTime, getLength, getName, getOption, getStartTime, getURI, getValue, getVersionMajor, getVersionMinor, hasAnnotations, hasDataType, hasIndexURI, hasOption, isFixedSizeData, isInTimeOrder, isReadOnly, isTerminated, listOptions, notInTimeOrder, setDataPathName, setDataSize, setDescription, setEndTime, setFirstDataTime, setFirstOffset, setFirstTime, setID, setIndexDataType, setIndexPathName, setIndexType, setInTimeOrder, setItemSize, setLastDataTime, setLastOffset, setLastTime, setLength, setName, setOption, setOptions, setReadOnly, setStartTime, setTerminated, setURI, setVersionMajor, setVersionMinor, syncHeader, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.timeindexing.index.ManagedIndexHeader
addIndexURI, getAllOptions, getIndexURI, getOption, hasIndexURI, hasOption, listOptions, notInTimeOrder, setDataPathName, setDataSize, setDescription, setEndTime, setFirstDataTime, setFirstOffset, setFirstTime, setID, setIndexDataType, setIndexPathName, setIndexType, setItemSize, setLastDataTime, setLastOffset, setLastTime, setLength, setName, setOption, setOptions, setReadOnly, setStartTime, setTerminated, setURI, syncHeader
 
Methods inherited from interface com.timeindexing.index.ExtendedIndexHeader
addDataType, getAnnotationStyle, getDataSize, getDataType, getFirstOffset, getItemSize, getLastOffset, hasAnnotations, hasDataType
 
Methods inherited from interface com.timeindexing.index.IndexHeader
getDataPathName, getDescription, getEndTime, getFirstDataTime, getFirstTime, getID, getIndexDataType, getIndexPathName, getIndexType, getLastDataTime, getLastTime, getLength, getName, getStartTime, getURI, isFixedSizeData, isInTimeOrder, isReadOnly, isTerminated
 

Constructor Detail

IndexDecoder

protected IndexDecoder()
Construct a decoder.


IndexDecoder

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


IndexDecoder

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

Method Detail

getHeaderPathName

public java.lang.String getHeaderPathName()
Get the header path name.


open

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

Specified by:
open in interface IndexHeaderReader
Throws:
java.io.IOException

open

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

Throws:
java.io.IOException

isOpen

public boolean isOpen()
Is the IndexHeader open

Specified by:
isOpen in interface IndexHeaderReader

close

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

Specified by:
close in interface IndexHeaderReader
Throws:
java.io.IOException

read

public long read()
          throws java.io.IOException
Read an index header from the header stream. TODO: Use Channels and ByteBuffer

Specified by:
read in interface IndexHeaderReader
Throws:
java.io.IOException

processDescription

protected java.lang.Object processDescription(HeaderOptionProcess what,
                                              java.nio.ByteBuffer readBuf)
Process a description


processIndexPath

protected java.lang.Object processIndexPath(HeaderOptionProcess what,
                                            java.nio.ByteBuffer readBuf)
Process a index path


processDataPath

protected java.lang.Object processDataPath(HeaderOptionProcess what,
                                           java.nio.ByteBuffer readBuf)
Process a data path


processDataType

protected java.lang.Object processDataType(HeaderOptionProcess what,
                                           java.nio.ByteBuffer readBuf)
Process a data type


processIsInTimeOrder

protected java.lang.Boolean processIsInTimeOrder(HeaderOptionProcess what,
                                                 java.nio.ByteBuffer readBuf)
Is the index in time order


processReferenceMapping

protected java.lang.Object processReferenceMapping(HeaderOptionProcess what,
                                                   java.nio.ByteBuffer readBuf)
Process the referenced indexes mapping