|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display.DataAdapter org.opensourcephysics.display.DataFile
public class DataFile
Field Summary | |
---|---|
protected static java.lang.String[] |
delimiters
|
Fields inherited from class org.opensourcephysics.display.DataAdapter |
---|
colNames, data, ID, name |
Constructor Summary | |
---|---|
DataFile(java.lang.String fileName)
Creates a DataFile using data in the given file. |
Method Summary | |
---|---|
java.util.List<Data> |
getDataList()
Some objects (eg, a Group) do not contain data, but a list of Data objects that do. |
protected static double[] |
getRowArray(int rowCount)
Returns an array of row numbers. |
java.lang.String |
open(java.lang.String fileName)
Opens an xml or data file specified by name. |
double[][] |
parseData(java.lang.String dataString,
java.lang.String fileName)
Parses character-delimited data from a string. |
protected static double[] |
parseDoubles(java.lang.String[] strings)
Parses a String array into doubles. |
protected static double[][] |
parseDoubles(java.lang.String text,
java.lang.String rowDelimiter,
java.lang.String colDelimiter)
Parses a String into doubles separated by specified row and column delimiters. |
protected static java.lang.String[] |
parseStrings(java.lang.String text,
java.lang.String delimiter)
Parses a String into tokens separated by a specified delimiter. |
protected static java.lang.String[][] |
parseStrings(java.lang.String text,
java.lang.String rowDelimiter,
java.lang.String colDelimiter)
Parses a String into tokens separated by specified row and column delimiters. |
protected java.lang.String |
readFirstLine(java.io.Reader in)
|
Methods inherited from class org.opensourcephysics.display.DataAdapter |
---|
getColumnNames, getData2D, getData3D, getDatasets, getFillColors, getID, getLineColors, getName, setColumnNames, setID, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String[] delimiters
Constructor Detail |
---|
public DataFile(java.lang.String fileName)
fileName
- Method Detail |
---|
public java.util.List<Data> getDataList()
getDataList
in interface Data
getDataList
in class DataAdapter
public java.lang.String open(java.lang.String fileName)
fileName
- the file name
public double[][] parseData(java.lang.String dataString, java.lang.String fileName)
dataString
- the data stringfileName
- name of file containing the data string (may be null)
protected java.lang.String readFirstLine(java.io.Reader in)
protected static java.lang.String[] parseStrings(java.lang.String text, java.lang.String delimiter)
text
- the text to parsedelimiter
- the delimiter
protected static java.lang.String[][] parseStrings(java.lang.String text, java.lang.String rowDelimiter, java.lang.String colDelimiter)
text
- the text to parserowDelimiter
- the column delimitercolDelimiter
- the column delimiter
protected static double[] parseDoubles(java.lang.String[] strings)
strings
- the String array to parse
protected static double[][] parseDoubles(java.lang.String text, java.lang.String rowDelimiter, java.lang.String colDelimiter)
text
- the text to parserowDelimiter
- the column delimitercolDelimiter
- the column delimiter
protected static double[] getRowArray(int rowCount)
rowCount
- length of the array
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |