|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
com.c5corp.c5dem.Reader
public class Reader
Reader.java is a general purpose text file reader that has methods for reading different data types out of the same file. It was designed for use with USGS DEM files and the data types found in that particular file format. It extends java.io.BufferedInputStream.
Field Summary | |
---|---|
protected boolean |
eof
|
Fields inherited from class java.io.BufferedInputStream |
---|
buf, count, marklimit, markpos, pos |
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
protected |
Reader(java.lang.String str)
Constructor for a reader accepts a String specifying the path to the DEM file. |
protected |
Reader(java.lang.String str,
int buf)
Constructor for a reader accepts a String specifying the path to the DEM file. |
protected |
Reader(java.net.URL url)
Constructor for a reader accepts a java.net.URL specifying the path to the dem file. |
Method Summary | |
---|---|
long |
getReaderPosition()
Returns the position of the internal reader |
char |
readCharRange(int from,
int to)
public char readCharRange(InputStream in, int from, int to);
reader that counts from (from) to in, grabing the chars in the
range public int from (which is the previous to) int to
if there is no input (just space), a single space is returned |
double[] |
ReadDataElementsDouble(int number_of_elements)
public double[] ReadDataElementsDouble(int number_of_elements);
reader that reads in a stream of Data from a Dem file
and converts the space separated input into elements of an array... |
int[] |
ReadDataElementsInt(int number_of_elements)
public int[] ReadDataElementsInt(int number_of_elements);
reader that reads in a stream of Data from a Dem file
and converts the space separated input into elements of an array... |
short[] |
ReadDataElementsShort(int number_of_elements)
public short[] ReadDataElementsShort(int number_of_elements);
A reader method that reads in a stream of Data from a Dem file
and converts the space separated input into elements of an array... |
double |
readDoubleRange(int from,
int to)
public double readDoubleRangeRange(int from, int to) reader that takes the current count from in, grabs the chars in that range, and if there is no input (just space), NaN is returned. |
short |
readShortRange(int from,
int to)
public short readShortRange(InputStream in, int from, int to)
reader that takes the current count from in, grabs the chars in that
range, and if there is no input (just space), -1 is returned |
java.lang.String |
readStringRange(int from,
int to)
public String readStringRange(int from, int to);
reader that takes the current count from in, grabs the chars in the
range public int from (typically the previous to) int to
if there is no input (just space), a single space is returned |
java.lang.String |
toString()
overrides java.lang.Object.toString() |
Methods inherited from class java.io.BufferedInputStream |
---|
available, close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.io.FilterInputStream |
---|
read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean eof
Constructor Detail |
---|
protected Reader(java.lang.String str) throws java.io.IOException
str
- String representation of a DEM file
java.io.IOException
protected Reader(java.lang.String str, int buf) throws java.io.IOException
str
- String representation of a DEM filebuf
- the buffer size
java.io.IOException
BufferedInputStream
protected Reader(java.net.URL url) throws java.io.IOException
url
- the URL pointing to a DEM
java.io.IOException
Method Detail |
---|
public short[] ReadDataElementsShort(int number_of_elements)
public short[] ReadDataElementsShort(int number_of_elements);
A reader method that reads in a stream of Data from a Dem file
and converts the space separated input into elements of an array...
has ability to stop at eof (also sets eof to true)
number_of_elements
- the number of elements to parse
public int[] ReadDataElementsInt(int number_of_elements)
public int[] ReadDataElementsInt(int number_of_elements);
reader that reads in a stream of Data from a Dem file
and converts the space separated input into elements of an array...
has ability to stop at eof (also sets eof to true). Added in version 1.0.2
because dem files denominated in meters actually contain decimeters.
number_of_elements
- the number of elements to parse
public double[] ReadDataElementsDouble(int number_of_elements)
public double[] ReadDataElementsDouble(int number_of_elements);
reader that reads in a stream of Data from a Dem file
and converts the space separated input into elements of an array...
has ability to stop at eof (also sets eof to true)
number_of_elements
- the number of elements to parse
public java.lang.String readStringRange(int from, int to)
public String readStringRange(int from, int to);
reader that takes the current count from in, grabs the chars in the
range public int from (typically the previous to) int to
if there is no input (just space), a single space is returned
from
- hereto
- here
public char readCharRange(int from, int to)
public char readCharRange(InputStream in, int from, int to);
reader that counts from (from) to in, grabing the chars in the
range public int from (which is the previous to) int to
if there is no input (just space), a single space is returned
from
- hereto
- here
public short readShortRange(int from, int to)
public short readShortRange(InputStream in, int from, int to)
reader that takes the current count from in, grabs the chars in that
range, and if there is no input (just space), -1 is returned
from
- hereto
- here
public double readDoubleRange(int from, int to)
from
- hereto
- here
public long getReaderPosition()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |