|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
javoids.TextLoader
public class TextLoader
A class to load text files robustly in a thread
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private static int |
BUFFERMAXIMUM
The maxmimum buffer size to use when storing loaded text files. |
private static int |
BUFFERSIZE
The buffer size to use when loading text files (amount read at once). |
private java.lang.StringBuffer |
fileData
The buffer to use for loading files. |
private java.lang.String |
fileName
The file name to use. |
private static long |
serialVersionUID
This is the version used for serializing/deserializing (storing/retrieving) this object |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
TextLoader(java.lang.String _fileName)
Constructor |
Method Summary | |
---|---|
java.lang.String |
getText()
|
void |
run()
Run a separate thread to load the file. |
java.lang.String |
toString()
Provide a String representation of this object. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final int BUFFERSIZE
private static final int BUFFERMAXIMUM
private java.lang.StringBuffer fileData
private java.lang.String fileName
Constructor Detail |
---|
public TextLoader(java.lang.String _fileName)
_fileName
- the name of the file to loadMethod Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.lang.String getText()
public java.lang.String toString()
toString
in class java.lang.Thread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |