CSVFormat
org.encog.util.csv

Class CSVFormat

  • All Implemented Interfaces:
    Serializable


    public class CSVFormatextends Objectimplements Serializable
    Specifies a CSV format. This allows you to determine if a decimal point or decimal comma is uses. It also specifies the character that should be used to separate numbers.
    See Also:
    Serialized Form
    • Field Detail

      • DECIMAL_POINT

        public static final CSVFormat DECIMAL_POINT
        Use a decimal point, and a comma to separate numbers.
      • DECIMAL_COMMA

        public static final CSVFormat DECIMAL_COMMA
        Use a decimal comma, and a semicolon to separate numbers.
      • ENGLISH

        public static final CSVFormat ENGLISH
        Decimal point is typically used in English speaking counties.
      • EG_FORMAT

        public static final CSVFormat EG_FORMAT
        EG files, internally use a decimal point and comma separator.
    • Constructor Detail

      • CSVFormat

        public CSVFormat()
        By default use USA conventions.
      • CSVFormat

        public CSVFormat(char decimal,         char separator)
        Construct a CSV format with he specified decimal and separator characters.
        Parameters:
        decimal - The decimal character.
        separator - The separator character.
    • Method Detail

      • getDecimalCharacter

        public static char getDecimalCharacter()
        Get the decimal character currently in use by the computer's default location.
        Returns:
        The decimal character used.
      • format

        public String format(double d,            int digits)
        Format the specified number to a string with the specified number of fractional digits.
        Parameters:
        d - The number to format.
        digits - The number of fractional digits.
        Returns:
        The number formatted as a string.
      • getDecimal

        public char getDecimal()
        Returns:
        The decimal character.
      • getNumberFormatter

        public NumberFormat getNumberFormatter()
        Returns:
        The number formatter.
      • getSeparator

        public char getSeparator()
        Returns:
        The separator character.
      • isValid

        public boolean isValid(String str)
        Determine if the string can be parsed.
        Parameters:
        str - The string to compare.
        Returns:
        True, if the string can be parsed.
      • parse

        public double parse(String str)
        Parse the specified string to a double.
        Parameters:
        str - The string to parse.
        Returns:
        The parsed number.

SCaVis 2.0 © jWork.ORG