org.gcube.indexmanagement.featureindexlibrary.vafile.io
Class IOHelper

java.lang.Object
  extended by org.gcube.indexmanagement.featureindexlibrary.vafile.io.IOHelper

public class IOHelper
extends Object

IO Helper class

Author:
UoA

Constructor Summary
IOHelper()
          Creates a new instance
 
Method Summary
 ApproximationFileEntry readApproximation(DataInputStream in)
          Reads an approximation
 ApproximationFileEntry readApproximation(RandomAccessFile rand)
          Reads an approximation
 VAFileParams readHeader(RandomAccessFile rand)
          Reads a header
 VectorFileEntry readRecord(DataInputStream in)
          Reads a record
 VectorFileEntry readRecord(RandomAccessFile rand)
          Reads a record
 void setIDLength(int idlength)
          Sets the property value
 void setVectorLength(int vectorlength)
          Sets the property value
 void skipHeader(RandomAccessFile rand)
          Skips the header
 void writeApproximation(ApproximationFileEntry entry, RandomAccessFile rand)
          Writes an Approximation
 void writeHeader(VAFileParams params, RandomAccessFile rand)
          Writes the header
 void writeRecord(VectorFileEntry entry, RandomAccessFile rand)
          Writes a record
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOHelper

public IOHelper()
Creates a new instance

Method Detail

setIDLength

public void setIDLength(int idlength)
                 throws Exception
Sets the property value

Parameters:
idlength - The property value
Throws:
Exception - An error

setVectorLength

public void setVectorLength(int vectorlength)
                     throws Exception
Sets the property value

Parameters:
vectorlength - The property value
Throws:
Exception - An error

writeHeader

public void writeHeader(VAFileParams params,
                        RandomAccessFile rand)
                 throws Exception
Writes the header

Parameters:
params - The VAFile header params
rand - The pointer
Throws:
Exception - An error

skipHeader

public void skipHeader(RandomAccessFile rand)
                throws Exception
Skips the header

Parameters:
rand - The pointer
Throws:
Exception - An error

readHeader

public VAFileParams readHeader(RandomAccessFile rand)
                        throws Exception
Reads a header

Parameters:
rand - The pointer
Returns:
The header
Throws:
Exception - An error

writeApproximation

public void writeApproximation(ApproximationFileEntry entry,
                               RandomAccessFile rand)
                        throws Exception
Writes an Approximation

Parameters:
entry - The entry
rand - The pointer
Throws:
Exception - An error

readApproximation

public ApproximationFileEntry readApproximation(RandomAccessFile rand)
Reads an approximation

Parameters:
rand - The pointer
Returns:
The entry

readApproximation

public ApproximationFileEntry readApproximation(DataInputStream in)
Reads an approximation

Parameters:
in - The pointer
Returns:
The entry

writeRecord

public void writeRecord(VectorFileEntry entry,
                        RandomAccessFile rand)
                 throws Exception
Writes a record

Parameters:
entry - The entry
rand - The pointer
Throws:
Exception - An error

readRecord

public VectorFileEntry readRecord(RandomAccessFile rand)
Reads a record

Parameters:
rand - The pointer
Returns:
Th erecord

readRecord

public VectorFileEntry readRecord(DataInputStream in)
Reads a record

Parameters:
in - The pointer
Returns:
The record


Copyright © 2012. All Rights Reserved.