uk.org.ogsadai.activity.indexedfiles
Class OMIMIndexWriter

java.lang.Object
  |
  +--uk.org.ogsadai.activity.indexedfiles.FlatFileIndexWriter
        |
        +--uk.org.ogsadai.activity.indexedfiles.OMIMIndexWriter

public class OMIMIndexWriter
extends FlatFileIndexWriter

Indexes OMIM data files.

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private static DAILogger LOG
          Logger object for logging in this class
private  java.util.HashMap mFields
          Fields (line types) that are being indexed
 
Fields inherited from class uk.org.ogsadai.activity.indexedfiles.FlatFileIndexWriter
DATA_FILE_NAME, DATA_LENGTH, DATA_OFFSET, mIndexWriter
 
Constructor Summary
OMIMIndexWriter(org.apache.lucene.index.IndexWriter indexwriter)
           
 
Method Summary
 java.lang.String[] getFields()
          Gets the indexed fields.
private  void indexFile(java.io.File file, java.lang.String relativePath)
          Indexes a OMIM data file.
 void indexFiles(java.io.File[] files, java.lang.String[] dirs)
          Indexes an array of flat files.
 void setFields(java.lang.String[] fields)
          Sets the fields for indexing
 
Methods inherited from class uk.org.ogsadai.activity.indexedfiles.FlatFileIndexWriter
getIndexWriter, setIndexWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

LOG

private static final DAILogger LOG
Logger object for logging in this class


mFields

private java.util.HashMap mFields
Fields (line types) that are being indexed

Constructor Detail

OMIMIndexWriter

public OMIMIndexWriter(org.apache.lucene.index.IndexWriter indexwriter)
Method Detail

indexFiles

public void indexFiles(java.io.File[] files,
                       java.lang.String[] dirs)
                throws java.io.FileNotFoundException,
                       java.io.IOException
Description copied from class: FlatFileIndexWriter
Indexes an array of flat files.

Specified by:
indexFiles in class FlatFileIndexWriter
Parameters:
files - An array of flat files to be indexed
dirs - Directories containing the files such that files[i] is located in relativeDirectories[i].
Throws:
java.io.FileNotFoundException - If any file is not found.
java.io.IOException - If there is a problem encountered when indexing a file.

getFields

public java.lang.String[] getFields()
Description copied from class: FlatFileIndexWriter
Gets the indexed fields.

Specified by:
getFields in class FlatFileIndexWriter
Returns:
names of the fields for indexing

setFields

public void setFields(java.lang.String[] fields)
Description copied from class: FlatFileIndexWriter
Sets the fields for indexing

Specified by:
setFields in class FlatFileIndexWriter
Parameters:
fields - The fields that are being indexed.

indexFile

private void indexFile(java.io.File file,
                       java.lang.String relativePath)
                throws java.io.FileNotFoundException,
                       java.io.IOException
Indexes a OMIM data file. This method loops through the lines of the file and reads the type of the FIELD line. Whenever the field name is contained in the fields known to this object the field is stored in the index.

Parameters:
file - The flat file to be indexed
relativePath - The relative path of the data file
Throws:
java.io.FileNotFoundException - If the file is not found.
java.io.IOException - If there is a problem encountered when indexing the file.