rlaramee
Class FromASCIItoBinaryFloat
java.lang.Object
|
+--rlaramee.FromASCIItoBinaryFloat
- public class FromASCIItoBinaryFloat
- extends java.lang.Object
Description This program converts a uniform resolution of floats
from ASCII to binary format
start date Fri 2 Mar '01
- Version:
- 1.0
- Author:
- Robert S Laramee
- See Also:
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
fileHandler
private FileHandler fileHandler
breakOut
private boolean breakOut
xDimension
private short xDimension
yDimension
private short yDimension
zDimension
private short zDimension
FromASCIItoBinaryFloat
public FromASCIItoBinaryFloat()
- constructor
getXdimension
private short getXdimension()
- Returns:
- xDimension the number of scalars along the x dimension of
the data set
setXdimension
private void setXdimension(short newX)
- Parameters:
newX
- the number of scalars along the x dimension of the data set
getYdimension
private short getYdimension()
- Returns:
- yDimension the number of scalars along the y dimension of
the data set
setYdimension
private void setYdimension(short newY)
- Parameters:
newY
- the number of scalars along the y dimension of the data set
getZdimension
private short getZdimension()
- Returns:
- zDimension the number of scalars along the z dimension of
the data set
setZdimension
private void setZdimension(short newZ)
- Parameters:
newZ
- the number of scalars along the z dimension of the data set
getFileHandler
private FileHandler getFileHandler()
- Returns:
- the fileHandler object
setFileHandler
private void setFileHandler(FileHandler newFileHandler)
- Parameters:
newFileHandler
- a fileHandler object
getBreakOut
private boolean getBreakOut()
- Returns:
- TRUE if we are to break out of a loop
setBreakOut
private void setBreakOut(boolean trueOrFalse)
- Parameters:
trueOrFalse
- is TRUE if we are to break out of a loop
startReading
public boolean startReading(java.lang.String inputFileName,
java.lang.String outputFileName)
- This method starts the reading process
- Parameters:
inputFileName
- the name of the input file to readoutputFileName
- the name of the output file to write
readAndWriteFloats
private int readAndWriteFloats(java.lang.String outputFileName)
- Parameters:
outputFileName
- the name of the output file to write- Returns:
- numCubesWritten return the number of cubes written
readFloat
private float readFloat()
- This method reads a single floating point number from ASCII file
parseFloat
private float parseFloat()
- This method parses an ASCII text floating point number
- Parameters:
stream
- a handle to the input stream- Returns:
- float the floating point number parsed
- Throws:
java.io.IOException
-
validRange
private boolean validRange(double value,
double min,
double max)
- Parameters:
value
- the value to validatemin
- the minimum allowable valuemax
- the maximum allowable value- Returns:
- true if the value is in the proper range
main
public static void main(java.lang.String[] args)
- The main() method runs the program
- Parameters:
inputFileName
- an input file nameoutputFileName
- an output file namelevel
- the level of resolution the current being read
is