|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectio.g96.in.InBlock
| Field Summary | |
(package private) java.util.regex.Pattern |
endPattern
|
(package private) java.lang.String |
fileName
|
(package private) java.util.regex.Pattern |
startPattern
|
(package private) java.io.BufferedReader |
stream
|
(package private) java.util.StringTokenizer |
tok
|
| Constructor Summary | |
InBlock()
|
|
InBlock(java.lang.String fn)
|
|
| Method Summary | |
static void |
assertBlockName(java.util.ArrayList block,
java.lang.String blockName)
check the block name (first line) of a block. |
static void |
assertBlockSize(java.util.ArrayList block,
int size)
perform a consistency check between the the number of lines a given block was espected to have and the number that was actually read in |
void |
close()
close the file stream and reset the file name |
java.util.HashMap |
getBlocks(java.util.ArrayList blockNames)
read blocks until all blocks corresponding to the block names have been read. |
java.util.ArrayList |
getNextBlock()
|
void |
open(java.lang.String fn)
|
static double[] |
parseDoubleArray(java.lang.String line)
parse an array of doubles from a string. |
static double[] |
parseDoubleArray(java.lang.String[] lines)
parse an array of doubles from an array of strings, one double per string. |
static double[] |
parseDoubleArray(java.lang.String line,
int length)
|
static double[][] |
parseDoubleMatrix(java.lang.String[] lines,
int nCols)
parse an matrix of doubles from an array of strings, nCols doubles per line. |
java.lang.String |
readTitle()
Gromos files are usually headed by a TITLE block. |
(package private) boolean |
skipLine(java.lang.String line)
|
java.util.ArrayList |
slurp()
slurp the whole contents of the file into a list of blocks |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
java.lang.String fileName
java.io.BufferedReader stream
java.util.StringTokenizer tok
java.util.regex.Pattern startPattern
java.util.regex.Pattern endPattern
| Constructor Detail |
public InBlock()
throws java.io.IOException
public InBlock(java.lang.String fn)
throws java.io.IOException
| Method Detail |
public void open(java.lang.String fn)
throws java.io.IOException
fn -
java.io.IOException
public void close()
throws java.io.IOException
java.io.IOException
public java.util.ArrayList getNextBlock()
throws java.io.IOException
java.io.IOException
public java.lang.String readTitle()
throws java.io.IOException
java.io.IOException
public static final void assertBlockSize(java.util.ArrayList block,
int size)
block - size -
public static final void assertBlockName(java.util.ArrayList block,
java.lang.String blockName)
block - blockName - boolean skipLine(java.lang.String line)
public static double[][] parseDoubleMatrix(java.lang.String[] lines,
int nCols)
lines - nCols -
public static double[] parseDoubleArray(java.lang.String[] lines)
lines -
public static double[] parseDoubleArray(java.lang.String line)
line -
public static double[] parseDoubleArray(java.lang.String line,
int length)
line - length - line must contain this many numbers
public java.util.HashMap getBlocks(java.util.ArrayList blockNames)
throws java.io.IOException
blockNames -
java.io.IOException
public java.util.ArrayList slurp()
throws java.io.IOException
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||