edu.hust.go.model
Class GoParser

java.lang.Object
  |
  +--edu.hust.go.model.GoParser
Direct Known Subclasses:
OboGoParser, XmlGoParser

public abstract class GoParser
extends java.lang.Object


Field Summary
(package private)  java.util.Vector dataPool
           
(package private) static int defaultPoolSize
           
(package private) static int defaultThreadNumber
           
(package private)  boolean m_ParserActive
           
static byte OBO
           
static byte OBOXML
           
static byte OWL
           
(package private)  int poolSize
           
static byte RDFXML
           
(package private)  java.lang.String target
           
(package private)  java.util.HashMap termMap
           
(package private)  int threadNumber
           
(package private)  java.util.HashMap threadPool
           
 
Constructor Summary
GoParser(java.lang.String _target)
           
GoParser(java.lang.String _target, int _maxThreadNumber)
           
GoParser(java.lang.String _target, int _maxThreadNumber, int _maxPoolSize)
           
 
Method Summary
protected  void addDataToPool(java.lang.Object data)
           
protected  void addTermToMap(java.lang.Object data, byte defType)
           
protected  java.lang.Object getDataFromPool()
           
abstract  edu.hust.go.term.GO_term getGoTermById(java.lang.String id)
           
 java.util.HashMap getTermMap()
          get the whole GO id-terms in GO definition.
protected  void parse(byte goDefType)
           
protected abstract  void parseTarget()
           
protected  boolean parsingInProgress()
           
protected  boolean queueProcessed()
           
protected  void removeThread(java.lang.String threadName)
           
protected  void setParserActive()
           
protected  void setParsingComplete()
           
protected  boolean threadActive()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBO

public static final byte OBO
See Also:
Constant Field Values

OBOXML

public static final byte OBOXML
See Also:
Constant Field Values

RDFXML

public static final byte RDFXML
See Also:
Constant Field Values

OWL

public static final byte OWL
See Also:
Constant Field Values

defaultThreadNumber

static final int defaultThreadNumber
See Also:
Constant Field Values

defaultPoolSize

static final int defaultPoolSize
See Also:
Constant Field Values

target

java.lang.String target

threadNumber

int threadNumber

poolSize

int poolSize

termMap

java.util.HashMap termMap

dataPool

java.util.Vector dataPool

threadPool

java.util.HashMap threadPool

m_ParserActive

boolean m_ParserActive
Constructor Detail

GoParser

public GoParser(java.lang.String _target)

GoParser

public GoParser(java.lang.String _target,
                int _maxThreadNumber)

GoParser

public GoParser(java.lang.String _target,
                int _maxThreadNumber,
                int _maxPoolSize)
Parameters:
_target - GO definition file
_maxThreadNumber - thread number
_maxPoolSize - GO term parse speed may slower than read thread, if the number of unparsed terms greater than maxPoolSize, new term has to wait until old terms have been parsed.
Method Detail

getTermMap

public java.util.HashMap getTermMap()
get the whole GO id-terms in GO definition.

Returns:
the key is GO ids, and the value is GO terms.
If the termType is SIMPLE_TERM, the value is DefaultGO_term.
If the termType is COMPLETE_TERM and the parse is OBOGoParser, the value is OBOGO_term.
If the termType is COMPLETE_TERM and the parse is SaxGoParser, the value is XMLGO_term.

getGoTermById

public abstract edu.hust.go.term.GO_term getGoTermById(java.lang.String id)

parse

protected void parse(byte goDefType)

parseTarget

protected abstract void parseTarget()

queueProcessed

protected boolean queueProcessed()

parsingInProgress

protected boolean parsingInProgress()

setParserActive

protected void setParserActive()

setParsingComplete

protected void setParsingComplete()

addDataToPool

protected void addDataToPool(java.lang.Object data)

getDataFromPool

protected java.lang.Object getDataFromPool()

addTermToMap

protected void addTermToMap(java.lang.Object data,
                            byte defType)

removeThread

protected void removeThread(java.lang.String threadName)

threadActive

protected boolean threadActive()