Module omix.api
Package omix.lang.io

Class CSVDoubleTable


public final class CSVDoubleTable
extends AbstractCSVTable<Double>
This class reads all data of a csv file as double values. It can give a minimal, maximal and average value for all entries of a column or of a row.
Author:
Dr. Peter Droste, Omix Visualization
  • Constructor Details

    • CSVDoubleTable

      @ConstructorProperties({"file","separator","horizontal","startLine"}) public CSVDoubleTable​(File file, String separator, boolean horizontal, int startLine)
      Creates a new table that reads the given file from a startline. The programmer has to specify if the csv file has a vertical header or a horizontal header. The data is seperated by the character given as separator. Cell content in the table may be quoted by the given quote character. The quote character itself can be content of a cell by a leading escape character. This constructor uses the " character as quote character and \ as escape character.
      Parameters:
      file -
      separator -
      horizontal -
      startLine -
    • CSVDoubleTable

      @ConstructorProperties({"file","separator","horizontal","startLine","decimalFormatSymbols","charset"}) public CSVDoubleTable​(File file, String separator, boolean horizontal, int startLine, DecimalFormatSymbols decimalFormatSymbols, Charset charset)
      Creates a new table that reads the given file from a startline. The programmer has to specify if the csv file has a vertical header or a horizontal header. The data is seperated by the character given as separator. Cell content in the table may be quoted by the given quote character. The quote character itself can be content of a cell by a leading escape character. This constructor uses the " character as quote character and \ as escape character.
      Parameters:
      file -
      separator -
      horizontal -
      startLine -
      charset - The character set of the input file (e.g. UTF-8)
    • CSVDoubleTable

      @ConstructorProperties({"file","separator","quoteChar","horizontal","startLine"}) public CSVDoubleTable​(File file, String separator, String quoteChar, boolean horizontal, int startLine)
      Creates a new table that reads the given file from a startline. The programmer has to specify if the csv file has a vertical header or a horizontal header. The data is seperated by the character given as separator. Cell content in the table may be quoted by the given quote character. The quote character itself can be content of a cell by a leading escape character. This constructor uses the \ as escape character.
      Parameters:
      file -
      separator -
      quoteChar -
      horizontal -
      startLine -
    • CSVDoubleTable

      @ConstructorProperties({"file","quoteChar","separator","horizontal","startLine","decimalFormatSymbols","charset"}) public CSVDoubleTable​(File file, String separator, String quoteChar, boolean horizontal, int startLine, DecimalFormatSymbols decimalFormatSymbols, Charset charset)
      Creates a new table that reads the given file from a startline. The programmer has to specify if the csv file has a vertical header or a horizontal header. The data is seperated by the character given as separator. Cell content in the table may be quoted by the given quote character. The quote character itself can be content of a cell by a leading escape character. This constructor uses the \ as escape character.
      Parameters:
      file -
      separator -
      quoteChar -
      horizontal -
      startLine -
      decimalFormatSymbols - The symbols of the decimal number format
      charset - The character set of the input file (e.g. UTF-8)
    • CSVDoubleTable

      @ConstructorProperties({"file","quoteChar","escapeChar","separator","horizontal","startLine","decimalFormatSymbols"}) public CSVDoubleTable​(File file, String separatorChar, String quoteChar, String escapeChar, boolean horizontal, int startLine)
      Creates a new table that reads the given file from a startline. The programmer has to specify if the csv file has a vertical header or a horizontal header. The data is seperated by the character given as separator. Cell content in the table may be quoted by the given quote character. The quote character itself can be content of a cell by a leading escape character.
      Parameters:
      file -
      separatorChar -
      quoteChar -
      escapeChar -
      horizontal -
      startLine -
    • CSVDoubleTable

      @ConstructorProperties({"file","quoteChar","escapeChar","separator","horizontal","startLine","decimalFormatSymbols","charset"}) public CSVDoubleTable​(File file, String separatorChar, String quoteChar, String escapeChar, boolean horizontal, int startLine, DecimalFormatSymbols decimalFormatSymbols, Charset charset)
      Creates a new table that reads the given file from a startline. The programmer has to specify if the csv file has a vertical header or a horizontal header. The data is seperated by the character given as separator. Cell content in the table may be quoted by the given quote character. The quote character itself can be content of a cell by a leading escape character.
      Parameters:
      file -
      separatorChar -
      quoteChar -
      escapeChar -
      horizontal -
      startLine -
      decimalFormatSymbols - The symbols of the decimal number format
      charset - The character set of the input file (e.g. UTF-8)
    • CSVDoubleTable

      @ConstructorProperties({"file","openingQuoteChar","closingQuoteChar","escapeChar","separator","horizontal","startLine","decimalFormatSymbols"}) public CSVDoubleTable​(File file, String separatorChar, String openingQuoteChar, String closingQuoteChar, String escapeChar, boolean horizontal, int startLine)
      Creates a new table that reads the given file from a startline. The programmer has to specify if the csv file has a vertical header or a horizontal header. The data is seperated by the character given as separator. Cell content in the table may be quoted by the given quote character. The quote character itself can be content of a cell by a leading escape character.
      Parameters:
      file -
      separatorChar -
      openingQuoteChar -
      closingQuoteChar -
      escapeChar -
      horizontal -
      startLine -
    • CSVDoubleTable

      @ConstructorProperties({"file","openingQuoteChar","closingQuoteChar","escapeChar","separator","horizontal","startLine","decimalFormatSymbols","charset"}) public CSVDoubleTable​(File file, String separatorChar, String openingQuoteChar, String closingQuoteChar, String escapeChar, boolean horizontal, int startLine, DecimalFormatSymbols decimalFormatSymbols, Charset charset)
      Creates a new table that reads the given file from a startline. The programmer has to specify if the csv file has a vertical header or a horizontal header. The data is seperated by the character given as separator. Cell content in the table may be quoted by the given quote character. The quote character itself can be content of a cell by a leading escape character.
      Parameters:
      file -
      separatorChar -
      openingQuoteChar -
      closingQuoteChar -
      escapeChar -
      horizontal -
      startLine -
      decimalFormatSymbols - The symbols of the decimal number format. If null, the C decimal format symbols are used.
      charset - The character set of the input file (e.g. UTF-8)
  • Method Details

    • format

      protected Double format​(String value)
      this method converts a String into a Double
      Specified by:
      format in class AbstractTable<Double>
      Parameters:
      value -
      Returns:
      Double object
      See Also:
      AbstractTable.format(java.lang.String)
    • generateArray

      protected Double[][] generateArray​(int i, int j)
      Description copied from class: AbstractTable
      This method must create the array T[][].
      Specified by:
      generateArray in class AbstractTable<Double>
      Returns:
      new Double[i][j]
      See Also:
      AbstractTable.generateArray(int, int)
    • min

      public double min​(int index)
      returns the minimum value of a row (index).
      Parameters:
      index -
      Returns:
      minimum
    • max

      public double max​(int index)
      returns the maximum value of a row (index).
      Parameters:
      index -
      Returns:
      maximum
    • avg

      public double avg​(int index)
      returns the average value of a row (index).
      Parameters:
      index -
      Returns:
      average
    • min

      public double min​(String identifier)
      returns the minimum value of a column (identifier).
      Parameters:
      identifier -
      Returns:
      minimum
    • max

      public double max​(String identifier)
      returns the maximum value of a column (identifier).
      Parameters:
      identifier -
      Returns:
      maximum
    • avg

      public double avg​(String identifier)
      returns the average value of a column (identifier).
      Parameters:
      identifier -
      Returns:
      average