public class TextFileReader extends Object
Constructor and Description |
---|
TextFileReader() |
Modifier and Type | Method and Description |
---|---|
double[] |
getAsDouble(int[] index)
Returns specified columns as array of double
|
double[] |
getAsDouble(int min,
int max) |
int[] |
getAsInt(int[] index)
returns specified columns as array of ints
|
int[] |
getAsInt(int min,
int max)
returns array of ints for given range of columns.
|
int |
getDataSize() |
static void |
main(String[] args) |
boolean |
openFile(String name)
Open a text file for reading.
|
boolean |
readNext()
reads the next line in the file and populates the internal list of tokens
|
void |
show() |
String |
toString()
returns string representation of the array that was read.
|
public boolean openFile(String name)
name
- name of the filepublic boolean readNext()
public int getDataSize()
public double[] getAsDouble(int min, int max)
public double[] getAsDouble(int[] index)
index
- array containing columns indicespublic int[] getAsInt(int min, int max)
min
- min number of columnmax
- max number of columnpublic int[] getAsInt(int[] index)
index
- array containing columns indicespublic String toString()
public void show()
public static void main(String[] args)
Jas4pp 1.5 © Java Analysis Studio for Particle Physics