Module omix.api
Package omix.lang.io

Class CSVIntegerTable


public final class CSVIntegerTable
extends AbstractCSVTable<Integer>
This class reads all data of a csv file as int 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 Summary

    Constructors 
    Constructor Description
    CSVIntegerTable​(File file, String separator, boolean horizontal, int startLine)
    Creates a new table that reads the given file from a startline.
    CSVIntegerTable​(File file, String separator, boolean horizontal, int startLine, Charset charset)
    Creates a new table that reads the given file from a startline.
    CSVIntegerTable​(File file, String separator, String quoteChar, boolean horizontal, int startLine)
    Creates a new table that reads the given file from a startline.
    CSVIntegerTable​(File file, String separator, String quoteChar, boolean horizontal, int startLine, Charset charset)
    Creates a new table that reads the given file from a startline.
    CSVIntegerTable​(File file, String separatorChar, String quoteChar, String escapeChar, boolean horizontal, int startLine)
    Creates a new table that reads the given file from a startline.
    CSVIntegerTable​(File file, String separatorChar, String quoteChar, String escapeChar, boolean horizontal, int startLine, Charset charset)
    Creates a new table that reads the given file from a startline.
    CSVIntegerTable​(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.
    CSVIntegerTable​(File file, String separatorChar, String openingQuoteChar, String closingQuoteChar, String escapeChar, boolean horizontal, int startLine, Charset charset)
    Creates a new table that reads the given file from a startline.
  • Method Summary

    Modifier and Type Method Description
    int avg​(int index)
    returns the average value of a row (index).
    int avg​(String identifier)
    returns the average value of a column (identifier).
    protected Integer format​(String value)
    this method converts a String into an Integer
    protected Integer[][] generateArray​(int i, int j)
    This method must create the array T[][].
    int max​(int index)
    returns the maximum value of a row (index).
    int max​(String identifier)
    returns the maximum value of a column (identifier).
    int min​(int index)
    returns the minimum value of a row (index).
    int min​(String identifier)
    returns the minimum value of a column (identifier).

    Methods inherited from class omix.lang.io.AbstractCSVTable

    data

    Methods inherited from class omix.lang.io.AbstractTable

    addIndex, available, columns, get, getIndex, length

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CSVIntegerTable

      @ConstructorProperties({"file","separator","horizontal","startLine"}) public CSVIntegerTable​(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 -
    • CSVIntegerTable

      @ConstructorProperties({"file","separator","quoteChar","horizontal","startLine"}) public CSVIntegerTable​(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 -
    • CSVIntegerTable

      @ConstructorProperties({"file","separator","quoteChar","escapeChar","horizontal","startLine"}) public CSVIntegerTable​(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 -
    • CSVIntegerTable

      @ConstructorProperties({"file","separator","openingQuoteChar","closingQuoteChar","escapeChar","horizontal","startLine"}) public CSVIntegerTable​(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 -
    • CSVIntegerTable

      @ConstructorProperties({"file","separator","horizontal","startLine","charset"}) public CSVIntegerTable​(File file, String separator, boolean horizontal, int startLine, 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)
    • CSVIntegerTable

      @ConstructorProperties({"file","separator","quoteChar","horizontal","startLine","charset"}) public CSVIntegerTable​(File file, String separator, String quoteChar, boolean horizontal, int startLine, 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 -
      charset - The character set of the input file (e.g. UTF-8)
    • CSVIntegerTable

      @ConstructorProperties({"file","separator","quoteChar","escapeChar","horizontal","startLine","charset"}) public CSVIntegerTable​(File file, String separatorChar, String quoteChar, String escapeChar, boolean horizontal, int startLine, 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 -
      charset - The character set of the input file (e.g. UTF-8)
    • CSVIntegerTable

      @ConstructorProperties({"file","separator","openingQuoteChar","closingQuoteChar","escapeChar","horizontal","startLine","charset"}) public CSVIntegerTable​(File file, String separatorChar, String openingQuoteChar, String closingQuoteChar, String escapeChar, boolean horizontal, int startLine, 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 -
      charset - The character set of the input file (e.g. UTF-8)
  • Method Details

    • format

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

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

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

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

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

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

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

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