org.codehaus.jet.hypothesis.io.readers
Class AbstractReader

java.lang.Object
  extended by org.codehaus.jet.hypothesis.io.readers.AbstractReader
Direct Known Subclasses:
AbstractBetaReader, AbstractCriticalValueReader, ProbabilityReader

public abstract class AbstractReader
extends java.lang.Object

Abstract base class for readers

Author:
Mauro Talevi

Field Summary
protected static java.lang.String COMMA
           
protected static java.lang.String COMMENT_PREFIX
           
protected static java.lang.String FIELD_SEPARATOR
           
protected static java.lang.String FIELD_SEPARATOR_REGEX
           
protected static java.lang.String NA_PREFIX
           
protected static java.text.NumberFormat NUMBER_FORMAT
           
protected static java.lang.String WHITESPACE
           
 
Constructor Summary
protected AbstractReader()
           
 
Method Summary
protected  java.lang.ClassLoader getClassLoader()
          Retrieves the context classloader of the current thread.
protected  java.io.Reader getReader(java.lang.String resource, java.lang.ClassLoader classLoader)
          Retrieves reader for resource in ClassLoader
protected  java.lang.String[] readLines(java.lang.String resource)
           
protected  java.lang.String[] toLines(java.io.Reader resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_FORMAT

protected static final java.text.NumberFormat NUMBER_FORMAT

COMMA

protected static final java.lang.String COMMA
See Also:
Constant Field Values

COMMENT_PREFIX

protected static final java.lang.String COMMENT_PREFIX
See Also:
Constant Field Values

FIELD_SEPARATOR

protected static final java.lang.String FIELD_SEPARATOR
See Also:
Constant Field Values

FIELD_SEPARATOR_REGEX

protected static final java.lang.String FIELD_SEPARATOR_REGEX
See Also:
Constant Field Values

NA_PREFIX

protected static final java.lang.String NA_PREFIX
See Also:
Constant Field Values

WHITESPACE

protected static final java.lang.String WHITESPACE
See Also:
Constant Field Values
Constructor Detail

AbstractReader

protected AbstractReader()
Method Detail

readLines

protected java.lang.String[] readLines(java.lang.String resource)
                                throws java.io.IOException
Throws:
java.io.IOException

toLines

protected java.lang.String[] toLines(java.io.Reader resource)
                              throws java.io.IOException
Throws:
java.io.IOException

getReader

protected java.io.Reader getReader(java.lang.String resource,
                                   java.lang.ClassLoader classLoader)
Retrieves reader for resource in ClassLoader

Parameters:
resource -
classLoader -
Returns:
A Reader

getClassLoader

protected java.lang.ClassLoader getClassLoader()
Retrieves the context classloader of the current thread. If no ContextClassLoader is found then the ClassLoader that loaded this class is returned.

Returns:
A ClassLoader


Copyright © 2006-2007. All Rights Reserved.