edu.iastate.biocyc.io
Class AttributeFileReaderEx

java.lang.Object
  extended by edu.iastate.biocyc.io.AttributeFileReaderEx

public class AttributeFileReaderEx
extends java.lang.Object

same as AttributeFileReader except implementing the data structure by Map of MultiMap

Author:
Jie Li

Field Summary
(package private) static org.apache.log4j.Logger logger
          log4j facility
(package private)  int PARSE
          file line scanner status
(package private)  int SEARCH
          file line scanner status for one unique-id record
 
Constructor Summary
AttributeFileReaderEx()
           
 
Method Summary
 void print(java.util.Map file)
          the map structure should contain the unique as the key, then another map as the value.
 java.util.Map read(java.io.InputStream inputStream)
          read data from the input stream
 java.util.Map read(java.lang.String filename)
          read in the file and turn into map data structure like ATP=> {UID=>[ATP], SYNONYM=>[ATPase, ADP]}
static java.lang.String trim(java.lang.String original, char header, char tail)
          cut the header and the tail of the string, do not consider if it is already a trimmed one
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
log4j facility


SEARCH

final int SEARCH
file line scanner status for one unique-id record

See Also:
Constant Field Values

PARSE

final int PARSE
file line scanner status

See Also:
Constant Field Values
Constructor Detail

AttributeFileReaderEx

public AttributeFileReaderEx()
Method Detail

read

public java.util.Map read(java.lang.String filename)
read in the file and turn into map data structure like ATP=> {UID=>[ATP], SYNONYM=>[ATPase, ADP]}
 IAracycFileReader reader = new AttributeFileReaderEx();
 
 Map map = reader.read(filename);
 
 


read

public java.util.Map read(java.io.InputStream inputStream)
read data from the input stream

Parameters:
inputStream - the input stream
Returns:
the map data

trim

public static java.lang.String trim(java.lang.String original,
                                    char header,
                                    char tail)
cut the header and the tail of the string, do not consider if it is already a trimmed one

Parameters:
original - the original string
header - the header char to be removed
tail - the tail char to be removed
Returns:
the trimmed string

print

public void print(java.util.Map file)
the map structure should contain the unique as the key, then another map as the value. the secondary map contain the string as the key and a set of value for the key

Parameters:
file - the data structure