public class TREETOPSDataReader extends java.lang.Object implements DataReader
Modified by: Joseph A. Huwaldt
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTENSION |
MAYBE, NO, RESOURCES, YES
Constructor and Description |
---|
TREETOPSDataReader() |
Modifier and Type | Method and Description |
---|---|
int |
canReadData(java.lang.String pathName,
java.io.BufferedInputStream input)
Method that determines if this reader can read data from the specified input
stream.
|
boolean |
canWriteData()
Returns false.
|
int |
compareTo(DataReader o)
Compares this object with the specified object for order based on the
toString().compareTo(o.toString()) method. |
java.lang.String |
getExtension()
Returns the preferred file extension (not including the ".") for files of this
DataReader's type.
|
java.util.List<DataSet> |
read(java.lang.String pathName,
java.io.InputStream input)
Method that reads in CLVTOPS formatted simulation data from the specified
input stream and returns that data as a list of
DataSet objects. |
java.util.List<DataSet> |
selectDataForSaving(java.awt.Frame parent,
java.util.List<DataSet> data)
This class can not write to the CLVTOPS format file(s), so this method always throws
an exception.
|
void |
setDefaultSetName(java.lang.CharSequence name)
Sets the default set name to use.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
void |
write(java.io.OutputStream output,
java.util.List<DataSet> data)
Method that writes out the data stored in the specified
DataSet object to
the specified output stream in CLVTOPS format. |
public static final java.lang.String EXTENSION
public TREETOPSDataReader()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getExtension()
getExtension
in interface DataReader
public int compareTo(DataReader o)
toString().compareTo(o.toString())
method. Returns a negative integer,
zero, or a positive integer as this object is less than, equal to, or greater than
the specified object.compareTo
in interface java.lang.Comparable<DataReader>
public int canReadData(java.lang.String pathName, java.io.BufferedInputStream input) throws java.io.IOException
canReadData
in interface DataReader
pathName
- The path to the file to be read.input
- An input stream containing the data to be read. Any methods that
read from this stream must first set a mark and then reset back to
that mark before the method returns (even if it returns with an
exception).java.io.IOException
- If the input stream could not be read from.public boolean canWriteData()
canWriteData
in interface DataReader
public java.util.List<DataSet> read(java.lang.String pathName, java.io.InputStream input) throws java.io.IOException
DataSet
objects.read
in interface DataReader
pathName
- The path to the file to be read. In addition to the *.dat file that
this should point to, there must be a *.crf file with the same prefix in the same
directory that will also be read in.input
- An input stream containing the space delimited array data file (*.dat).java.io.IOException
- If there is a problem reading the specified stream.public void setDefaultSetName(java.lang.CharSequence name)
setDefaultSetName
in interface DataReader
name
- The name to use as the default set name.public java.util.List<DataSet> selectDataForSaving(java.awt.Frame parent, java.util.List<DataSet> data)
selectDataForSaving
in interface DataReader
parent
- data
- public void write(java.io.OutputStream output, java.util.List<DataSet> data) throws java.io.IOException
DataSet
object to
the specified output stream in CLVTOPS format. This method will throw an exception
as writing to this format is not supported.write
in interface DataReader
output
- The output stream to which the data is to be written.data
- A list of DataSet
objects containing data to be written out.java.io.IOException
- If there is a problem writing to the specified stream.