apollo.util
Class OBOParser

java.lang.Object
  extended by apollo.util.OBOParser

public class OBOParser
extends java.lang.Object

This class will parse OBO files and generate indexes on different identifiers (e.g. id, name, etc)

Author:
elee

Constructor Summary
OBOParser(java.util.Collection<java.lang.String> fnames)
          Build an OBOParser from a collection of filenames (defaults to non-case sensitive)
OBOParser(java.util.Collection<java.lang.String> fnames, boolean isCaseSensitive)
          Build an OBOParser from a collection of filenames and a flag for whether the indexing should be case sensitive
OBOParser(java.lang.String fname)
          Build an OBOParser from a filename (defaults to non-case sensitive)
OBOParser(java.lang.String fname, boolean isCaseSensitive)
          Build an OBOParser from a filename and a flag for whether the indexing should be case sensitive
 
Method Summary
 org.obo.datamodel.IdentifiedObject getTermById(java.lang.String id)
          Get a term IdentifiedObject by ID
 Pair<org.obo.datamodel.IdentifiedObject,java.lang.String> getTermByName(java.lang.String name)
          Get a term IdentifiedObject by name
 boolean hasTermWithId(java.lang.String id)
          Check to see if a term with the given ID exists
 boolean hasTermWithName(java.lang.String name)
          Check to see if a term with the given name exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OBOParser

public OBOParser(java.lang.String fname)
          throws java.io.IOException,
                 org.obo.dataadapter.OBOParseException
Build an OBOParser from a filename (defaults to non-case sensitive)

Parameters:
fname - - OBO filename to parse
Throws:
java.io.IOException
org.obo.dataadapter.OBOParseException

OBOParser

public OBOParser(java.util.Collection<java.lang.String> fnames)
          throws java.io.IOException,
                 org.obo.dataadapter.OBOParseException
Build an OBOParser from a collection of filenames (defaults to non-case sensitive)

Parameters:
fnames - - OBO filenames to parse
Throws:
java.io.IOException
org.obo.dataadapter.OBOParseException

OBOParser

public OBOParser(java.lang.String fname,
                 boolean isCaseSensitive)
          throws java.io.IOException,
                 org.obo.dataadapter.OBOParseException
Build an OBOParser from a filename and a flag for whether the indexing should be case sensitive

Parameters:
fname - - OBO filename to parse
isCaseSensitive - - whether the indexing should be case sensitive
Throws:
java.io.IOException
org.obo.dataadapter.OBOParseException

OBOParser

public OBOParser(java.util.Collection<java.lang.String> fnames,
                 boolean isCaseSensitive)
          throws java.io.IOException,
                 org.obo.dataadapter.OBOParseException
Build an OBOParser from a collection of filenames and a flag for whether the indexing should be case sensitive

Parameters:
fname - - OBO filenames to parse
isCaseSensitive - - whether the indexing should be case sensitive
Throws:
java.io.IOException
org.obo.dataadapter.OBOParseException
Method Detail

getTermById

public org.obo.datamodel.IdentifiedObject getTermById(java.lang.String id)
Get a term IdentifiedObject by ID

Parameters:
id - - ID of the term object
Returns:
IdentifiedObject for the ID (null if not found)

getTermByName

public Pair<org.obo.datamodel.IdentifiedObject,java.lang.String> getTermByName(java.lang.String name)
Get a term IdentifiedObject by name

Parameters:
name - - name of the term object
Returns:
IdentifiedObject for the name (null if not found)

hasTermWithId

public boolean hasTermWithId(java.lang.String id)
Check to see if a term with the given ID exists

Parameters:
id - - ID to search against
Returns:
whether a term exists with the given ID

hasTermWithName

public boolean hasTermWithName(java.lang.String name)
Check to see if a term with the given name exists

Parameters:
name - - name to search against
Returns:
whether a term exists with the given name