## visad.data.text
Class TextAdapter

    java.lang.Object
      visad.data.text.TextAdapter

public class TextAdapter
extends Object

this is an VisAD file adapter for comma-, tab- and blank-separated ASCII text file data. It will attempt to create a FlatField from the data and descriptions given in the file and/or the constructor. The text files contained delimited data. The delimiter is determined as follows: if the file has a well-known extension (.csv, .tsv, .bsv) then the delimiter is implied by the extension. In all other cases, the delimiter for the data (and for the "column labels") is determined by reading the first line and looking, in order, for a tab, comma, or blank. Which ever one is found first is taken as the delimiter. Two extra pieces of information are needed: the VisAD "MathType" which is specified as a string (e.g., (x,y)->(temperature)) and may either be the first line of the file or passed in through one of the constructors. The second item are the "column labels" which contain the names of each field in the data. The names of all range components specified in the "MathType" must appear. The names of domain components are optional. The values in this string are separated by the delimiter, as defined above. See visad.data.text.README.text for more details.

Field Summary
`(package private) double[]` `domainErrorEstimates`
`(package private) Unit[]` `domainUnits`
`(package private) int[][]` `hdrColumns`
`(package private) double[]` `hdrErrorEstimates`
`(package private) String[]` `hdrFormatStrings`
`(package private) int[]` `hdrIsInterval`
`(package private) String[]` `hdrMissingStrings`
`(package private) double[]` `hdrMissingValues`
`(package private) String[]` `hdrNames`
`(package private) double[]` `hdrOffsets`
`(package private) double[]` `hdrScales`
`(package private) Unit[]` `hdrUnits`
`(package private) double[]` `rangeErrorEstimates`
`(package private) Set[]` `rangeSets`
`(package private) Unit[]` `rangeUnits`
`(package private) int[][]` `values_to_index`

Constructor Summary
`TextAdapter(String filename)` Create a VisAD FlatField from a local Text (comma-, tab- or blank-separated values) ASCII file
`TextAdapter(String filename, String map, String params)` Create a VisAD FlatField from a local Text (comma-, tab- or blank-separated values) ASCII file
`TextAdapter(URL url)` Create a VisAD FlatField from a remote Text (comma-, tab- or blank-separated values) ASCII file
`TextAdapter(URL url, String map, String params)` Create a VisAD FlatField from a local Text (comma-, tab- or blank-separated values) ASCII file

Method Summary
`Field` `getData()` get the data
`(package private) float[][]` `getDomSamples(int comp, int numDomValues, ArrayList domValues)`
`(package private) double` `getVal(String s, int k)`
`(package private) void` `readit(InputStream is, String map, String params)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### hdrNames

    String[] hdrNames

### hdrUnits

    Unit[] hdrUnits

### hdrMissingValues

    double[] hdrMissingValues

### hdrMissingStrings

    String[] hdrMissingStrings

### hdrFormatStrings

    String[] hdrFormatStrings

### hdrIsInterval

    int[] hdrIsInterval

### hdrErrorEstimates

    double[] hdrErrorEstimates

### rangeErrorEstimates

    double[] rangeErrorEstimates

### rangeUnits

    Unit[] rangeUnits

### rangeSets

    Set[] rangeSets

### domainErrorEstimates

    double[] domainErrorEstimates

### domainUnits

    Unit[] domainUnits

### hdrScales

    double[] hdrScales

### hdrOffsets

    double[] hdrOffsets

### hdrColumns

    int[][] hdrColumns

### values_to_index

    int[][] values_to_index

Constructor Detail

### TextAdapter

    public TextAdapter(String filename)
                throws IOException,
                       VisADException

  Create a VisAD FlatField from a local Text (comma-, tab- or blank-separated values) ASCII file

Parameters:
  `filename` - name of local file.
Throws:
  `IOException` - if there was a problem reading the file.
  `VisADException` - if an unexpected problem occurs.

### TextAdapter

    public TextAdapter(String filename,
                       String map,
                       String params)
                throws IOException,
                       VisADException

  Create a VisAD FlatField from a local Text (comma-, tab- or blank-separated values) ASCII file

Parameters:
  `filename` - name of local file.
  `map` - the VisAD "MathType" as a string defining the FlatField
  `params` - the list of parameters used to define what columns of the text file correspond to what MathType parameters.
Throws:
  `IOException` - if there was a problem reading the file.
  `VisADException` - if an unexpected problem occurs.

### TextAdapter

    public TextAdapter(URL url)
                throws IOException,
                       VisADException

  Create a VisAD FlatField from a remote Text (comma-, tab- or blank-separated values) ASCII file

Parameters:
  `url` - File URL.
Throws:
  `IOException` - if there was a problem reading the file.
  `VisADException` - if an unexpected problem occurs.

### TextAdapter

    public TextAdapter(URL url,
                       String map,
                       String params)
                throws IOException,
                       VisADException

  Create a VisAD FlatField from a local Text (comma-, tab- or blank-separated values) ASCII file

Parameters:
  `url` - File URL.
  `map` - the VisAD "MathType" as a string defining the FlatField
  `params` - the list of parameters used to define what columns of the text file correspond to what MathType parameters.
Throws:
  `IOException` - if there was a problem reading the file.
  `VisADException` - if an unexpected problem occurs.

Method Detail

### readit

    void readit(InputStream is,
                String map,
                String params)
          throws IOException,
                 VisADException

  Throws:
    `IOException`
    `VisADException`

### getVal

    double getVal(String s,
                  int k)

### getDomSamples

    float[][] getDomSamples(int comp,
                            int numDomValues,
                            ArrayList domValues)

### getData

    public Field getData()

  get the data

  Returns:
    a Field of the data read from the file