org.autoplot.csv.TableOps
I'd still like to refactor all the table-type sources to get the common codes.
These include:
TableOps( )
columnIndex
columnIndex( String name, String[] fieldNames ) → int
returns the field index of the name, which can be:
- a column name
- an implicit column name "field1"
- a column index (0 is the first column)
- a negative column index (-1 is the last column)
Parameters
name - a String
fieldNames - the field names for each column.
Returns:
the index of the field, or -1 if the column doesn't exist.
[search for examples]
[view on GitHub]
[view on old javadoc]
getDelim
getDelim( java.io.PushbackInputStream thein ) → char
get the delimiter, either a comma or semicolon, by looking at the first
few lines of the file. The pushbackInputStream should be returned at
the zeroth byte.
Parameters
thein - the PushbackInputStream, which will be at the zeroth byte to start and the zeroth byte when this is done.
Returns:
the delimiter.
[search for examples]
[view on GitHub]
[view on old javadoc]
getFieldIndex
getFieldIndex( String string, String[] fieldNames ) → int
returns the index of the field. Supports the name, or field0, or 0, etc.
Parameters
string - the field for which we want to identify the index
fieldNames - the field names for each column.
Returns:
the field index, or -1 if the column doesn't exist.
[search for examples]
[view on GitHub]
[view on old javadoc]
parseRangeStr
parseRangeStr( String o, String[] fieldNames ) → int[]
parse range strings like "3:6", "3:-5", and "Bx_gsm-Bz_gsm"
if the delimiter is colon, then the end is exclusive. If it is "-",
then it is inclusive. For example,
- 3:6 -> [3,6]
- 3-5 -> [3,6]
Parameters
o - the range string or field names, etc.
fieldNames - the field names for each column.
Returns:
the two-element range, where first index is inclusive, second is exclusive.
[search for examples]
[view on GitHub]
[view on old javadoc]