edu.sc.seis.sod.source

## Class AbstractCSVSource

- java.lang.Object
- - edu.sc.seis.sod.source.AbstractSource
  - - edu.sc.seis.sod.source.AbstractCSVSource

- All Implemented Interfaces:
    Source
  Direct Known Subclasses:
    CSVNetworkSource

      public abstract class AbstractCSVSource
      extends AbstractSource

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `csvFilename`
    `static edu.iris.Fissures.Time` | `DEFAULT_END`
    `static edu.iris.Fissures.Time` | `DEFAULT_TIME`
    `static java.lang.String` | `DEPTH`
    `static java.lang.String` | `DEPTH_UNITS`
    `static java.lang.String` | `ELEVATION`
    `static java.lang.String` | `ELEVATION_UNITS`
    `static java.lang.String` | `FE_GEO_REGION`
    `static java.lang.String` | `FE_REGION`
    `static java.lang.String` | `FE_REGION_TYPE`
    `static java.lang.String` | `FE_SEIS_REGION`
    `static java.lang.String` | `LATITUDE`
    `static java.lang.String` | `LONGITUDE`
    `static java.lang.String` | `NAME`
    `static java.lang.String` | `UNKNOWN`

    - ### Fields inherited from class edu.sc.seis.sod.source.AbstractSource

      `name, NAME_ELEMENT, RETRIES_ELEMENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractCSVSource(org.w3c.dom.Element config, java.lang.String defaultName)`
    `AbstractCSVSource(java.lang.String name)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `concatenateValidFields()`
    `abstract java.lang.String[]` | `getFields()`
    `boolean` | `isValidField(java.lang.String field)`
    `static double` | `loadDouble(java.util.List<java.lang.String> headers, com.csvreader.CsvReader csvReader, java.lang.String headerName, double defaultValue)`
    `static float` | `loadFloat(java.util.List<java.lang.String> headers, com.csvreader.CsvReader csvReader, java.lang.String headerName, float defaultValue)`
    `static java.lang.String` | `loadString(java.util.List<java.lang.String> headers, com.csvreader.CsvReader csvReader, java.lang.String headerName, java.lang.String defaultValue)`
    `static edu.iris.Fissures.Time` | `loadTime(java.util.List<java.lang.String> headers, com.csvreader.CsvReader csvReader, java.lang.String headerName, edu.iris.Fissures.Time defaultTime)`
    `static edu.iris.Fissures.model.UnitImpl` | `loadUnit(java.util.List<java.lang.String> headers, com.csvreader.CsvReader csvReader, java.lang.String headerName, edu.iris.Fissures.model.UnitImpl defaultUnit)`
    `java.util.List<java.lang.String>` | `validateHeaders(com.csvreader.CsvReader csvReader)`

    - ### Methods inherited from class edu.sc.seis.sod.source.AbstractSource

      `appendToName, getFissuresNamingService, getName, getRetries, getRetryStrategy, setRetryStrategy`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LONGITUDE

          public static final java.lang.String LONGITUDE

      See Also:
        Constant Field Values

    - #### LATITUDE

          public static final java.lang.String LATITUDE

      See Also:
        Constant Field Values

    - #### ELEVATION

          public static final java.lang.String ELEVATION

      See Also:
        Constant Field Values

    - #### DEPTH

          public static final java.lang.String DEPTH

      See Also:
        Constant Field Values

    - #### NAME

          public static final java.lang.String NAME

      See Also:
        Constant Field Values

    - #### FE_SEIS_REGION

          public static final java.lang.String FE_SEIS_REGION

      See Also:
        Constant Field Values

    - #### FE_GEO_REGION

          public static final java.lang.String FE_GEO_REGION

      See Also:
        Constant Field Values

    - #### FE_REGION

          public static final java.lang.String FE_REGION

      See Also:
        Constant Field Values

    - #### FE_REGION_TYPE

          public static final java.lang.String FE_REGION_TYPE

      See Also:
        Constant Field Values

    - #### DEPTH_UNITS

          public static final java.lang.String DEPTH_UNITS

      See Also:
        Constant Field Values

    - #### ELEVATION_UNITS

          public static final java.lang.String ELEVATION_UNITS

      See Also:
        Constant Field Values

    - #### UNKNOWN

          public static final java.lang.String UNKNOWN

      See Also:
        Constant Field Values

    - #### DEFAULT_TIME

          public static final edu.iris.Fissures.Time DEFAULT_TIME

    - #### DEFAULT_END

          public static final edu.iris.Fissures.Time DEFAULT_END

    - #### csvFilename

          protected java.lang.String csvFilename

  - ### Constructor Detail

    - #### AbstractCSVSource

          public AbstractCSVSource(org.w3c.dom.Element config,
                                   java.lang.String defaultName)

    - #### AbstractCSVSource

          public AbstractCSVSource(java.lang.String name)

  - ### Method Detail

    - #### getFields

          public abstract java.lang.String[] getFields()

    - #### isValidField

          public boolean isValidField(java.lang.String field)

    - #### concatenateValidFields

          public java.lang.String concatenateValidFields()

    - #### validateHeaders

          public java.util.List<java.lang.String> validateHeaders(com.csvreader.CsvReader csvReader)
                                                           throws java.io.IOException,
                                                                  java.io.FileNotFoundException,
                                                                  ConfigurationException

      Throws:
        `java.io.IOException`
        `java.io.FileNotFoundException`
        `ConfigurationException`

    - #### loadFloat

          public static float loadFloat(java.util.List<java.lang.String> headers,
                                        com.csvreader.CsvReader csvReader,
                                        java.lang.String headerName,
                                        float defaultValue)
                                 throws UserConfigurationException,
                                        java.io.IOException

      Throws:
        `UserConfigurationException`
        `java.io.IOException`

    - #### loadDouble

          public static double loadDouble(java.util.List<java.lang.String> headers,
                                          com.csvreader.CsvReader csvReader,
                                          java.lang.String headerName,
                                          double defaultValue)
                                   throws UserConfigurationException,
                                          java.io.IOException

      Throws:
        `UserConfigurationException`
        `java.io.IOException`

    - #### loadString

          public static java.lang.String loadString(java.util.List<java.lang.String> headers,
                                                    com.csvreader.CsvReader csvReader,
                                                    java.lang.String headerName,
                                                    java.lang.String defaultValue)
                                             throws UserConfigurationException,
                                                    java.io.IOException

      Throws:
        `UserConfigurationException`
        `java.io.IOException`

    - #### loadUnit

          public static edu.iris.Fissures.model.UnitImpl loadUnit(java.util.List<java.lang.String> headers,
                                                                  com.csvreader.CsvReader csvReader,
                                                                  java.lang.String headerName,
                                                                  edu.iris.Fissures.model.UnitImpl defaultUnit)
                                                           throws UserConfigurationException,
                                                                  java.io.IOException

      Throws:
        `UserConfigurationException`
        `java.io.IOException`

    - #### loadTime

          public static edu.iris.Fissures.Time loadTime(java.util.List<java.lang.String> headers,
                                                        com.csvreader.CsvReader csvReader,
                                                        java.lang.String headerName,
                                                        edu.iris.Fissures.Time defaultTime)
                                                 throws UserConfigurationException,
                                                        java.io.IOException

      Throws:
        `UserConfigurationException`
        `java.io.IOException`