|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nist.microanalysis.EPQTools.RippleFile
public class RippleFile
A class for reading and writing LISPIX-style Ripple files (rpl/raw)
| Field Summary | |
|---|---|
static java.lang.String |
BIG_ENDIAN
|
static java.lang.String |
DONT_CARE_ENDIAN
|
static java.lang.String |
DONT_CARE_ORDER
|
static java.lang.String |
FLOAT
|
static java.lang.String |
IMAGE_ORDER
|
static java.lang.String |
LITTLE_ENDIAN
|
static java.lang.String |
SIGNED
|
static java.lang.String |
UNSIGNED
|
static java.lang.String |
VECTOR_ORDER
|
| Constructor Summary | |
|---|---|
RippleFile(int width,
int height,
int depth,
java.lang.String dataType,
int byteDepth,
java.lang.String order,
java.lang.String rplFile,
java.lang.String rawFile)
Constructs a new RippleFile with the specified properties. |
|
RippleFile(java.lang.String rplFile,
boolean readOnly)
Constructs a RippleFile from the name of the header file. |
|
RippleFile(java.lang.String rplFile,
java.lang.String rawFile,
boolean readOnly)
Constructs a RippleFile given explicit paths to the Ripple and raw files. |
|
| Method Summary | |
|---|---|
void |
close()
close - Closes the associated disk files. |
int |
fileSize()
fileSize - Returns the size of the full raw file in bytes. |
int |
getCurrentCol()
getCurrentCol - Returns the column on which the next read/write will happen |
int |
getCurrentItem()
getCurrentItem - Returns the item index on which the next read/write will happen |
int |
getCurrentRow()
getCurrentRow - Returns the row on which the next read/write will happen |
java.lang.String |
getDataType()
getDataType - Returns the type of data item |
int |
getDatumSize()
getDatumSize - Returns the size in bytes of the underlying data objects |
int |
getDepth()
getDepth - Returns the depth of the underlying data matrix |
int |
getHeight()
getHeight - Returns the height of the underlying data matrix |
int |
getWidth()
getWidth - Returns the width of the underlying data matrix |
boolean |
isEof()
isEof - Does the current position represent the end-of-file (end of data) |
double |
readDouble()
readDouble - Read a single datum and return the value as a double. |
double[] |
readDouble(int len)
readDouble - read len count data objects and return them as an array of doubles. |
double[] |
readDoubleItem()
readDoubleItem - read depth (getDepth()) count of data objects and return them as an array of doubles. |
int |
readInt()
readInt - Read a single integer |
int[] |
readInt(int len)
readInt - read len count of integers |
int[] |
readIntItem()
readIntItem - read depth (getDepth()) count of integer |
long |
readUnsigned()
readUnsigned - Read a single unsigned integer |
void |
seek(int row,
int col)
seek - Moves the read/write pointer to the start of the specified item at [row,col] |
void |
seek(int row,
int col,
int item)
seek - Moves the read/write pointer to the start of the specified datum at [row,col,item] |
void |
write(double val)
write - Write a single double |
void |
write(double[] vals)
write - Write an array of doubles |
void |
write(int val)
write - Write a single integer |
void |
write(int[] vals)
write - Write an array of integers (converts to float if necessary to be compatible with the underlying file.) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BIG_ENDIAN
public static final java.lang.String LITTLE_ENDIAN
public static final java.lang.String DONT_CARE_ENDIAN
public static final java.lang.String IMAGE_ORDER
public static final java.lang.String VECTOR_ORDER
public static final java.lang.String DONT_CARE_ORDER
public static final java.lang.String SIGNED
public static final java.lang.String UNSIGNED
public static final java.lang.String FLOAT
| Constructor Detail |
|---|
public RippleFile(int width,
int height,
int depth,
java.lang.String dataType,
int byteDepth,
java.lang.String order,
java.lang.String rplFile,
java.lang.String rawFile)
throws java.io.IOException
width - - The width of each row (# of columns) within the Ripple fileheight - - The number of rowsdepth - - The number of data items at each [row,col] positiondataType - - One of RippleFile.SIGNED, RippleFile.UNSIGNED or
RippleFile.FLOATbyteDepth - - 1, 2, 4 for SIGNED or UNSIGNED, 4 or 8 for FLOATorder - - BIG_ENDIAN, LITTLE_ENDIAN or DONT_CARE_ENDIANrplFile - - File name (usually *.rpl)rawFile - - File name (usually *.raw)
java.io.IOException
public RippleFile(java.lang.String rplFile,
boolean readOnly)
throws java.lang.Exception,
java.io.IOException,
java.io.FileNotFoundException
rplFile - The name of the Ripple header filereadOnly - Should the file be opened as read-only?
java.lang.Exception
java.io.IOException
java.io.FileNotFoundException
public RippleFile(java.lang.String rplFile,
java.lang.String rawFile,
boolean readOnly)
throws java.lang.Exception,
java.io.IOException,
java.io.FileNotFoundException
rplFile - The name of the Ripple header filerawFile - The name of the raw filereadOnly - Should the file be opened as read-only?
java.lang.Exception
java.io.IOException
java.io.FileNotFoundException| Method Detail |
|---|
public int fileSize()
public void close()
throws java.io.IOException
java.io.IOException
public void seek(int row,
int col)
throws java.io.IOException
row - col -
java.io.IOException
public void seek(int row,
int col,
int item)
throws java.io.IOException
row - col - item -
java.io.IOException
public double readDouble()
throws java.io.IOException
java.io.IOException
public int readInt()
throws java.io.IOException
java.io.IOException
public long readUnsigned()
throws java.io.IOException
java.io.IOException
public int[] readInt(int len)
throws java.io.IOException
len -
java.io.IOException
public double[] readDouble(int len)
throws java.io.IOException
len -
java.io.IOException
public double[] readDoubleItem()
throws java.io.IOException
java.io.IOException
public int[] readIntItem()
throws java.io.IOException
java.io.IOException
public void write(int val)
throws java.io.IOException
val -
java.io.IOException
public void write(double val)
throws java.io.IOException
val -
java.io.IOException
public void write(int[] vals)
throws java.io.IOException
vals -
java.io.IOException
public void write(double[] vals)
throws java.io.IOException
vals -
java.io.IOExceptionpublic int getWidth()
public int getHeight()
public int getDepth()
public int getDatumSize()
public java.lang.String getDataType()
public int getCurrentRow()
public int getCurrentCol()
public int getCurrentItem()
public boolean isEof()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||