com.facetmap.simple
Class DelimitedResourceReader

java.lang.Object
  extended bycom.facetmap.simple.DelimitedResourceReader

public class DelimitedResourceReader
extends java.lang.Object

Reads Resources from plaintext and registers them in a SimpleResourceSpace. Objects of this class cannot be accessed by multiple threads at once -- consumers should synchronize access, or better yet, create different instantiations for different operations.


Field Summary
protected  Map mHome
           
protected  SimpleResourceSpace rHome
           
 
Constructor Summary
DelimitedResourceReader(SimpleResourceSpace rHome, Map mHome)
           
 
Method Summary
protected  SimpleResource createResource(java.lang.String desc)
           
 java.lang.String parse(java.io.BufferedReader r)
          This method does not do its own synchronization; you should control thread issues from somewhere else, preferably by synchronizing on the underlying Map.
 void write(java.io.File file, boolean fileIntegrity)
          Writes the ResourceSpace to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rHome

protected SimpleResourceSpace rHome

mHome

protected Map mHome
Constructor Detail

DelimitedResourceReader

public DelimitedResourceReader(SimpleResourceSpace rHome,
                               Map mHome)
Method Detail

parse

public java.lang.String parse(java.io.BufferedReader r)
                       throws java.io.IOException,
                              DataException,
                              InternalException
This method does not do its own synchronization; you should control thread issues from somewhere else, preferably by synchronizing on the underlying Map.

Throws:
java.io.IOException
DataException
InternalException

createResource

protected SimpleResource createResource(java.lang.String desc)

write

public void write(java.io.File file,
                  boolean fileIntegrity)
           throws java.io.IOException
Writes the ResourceSpace to the given file.

Parameters:
fileIntegrity - - if true, the method will protect any existing version of the file until the write operation is complete.
Throws:
java.io.IOException