com.panayotis.gnuplot.dataset.parser
Class NumericDataParser

java.lang.Object
  extended by com.panayotis.gnuplot.dataset.parser.NumericDataParser
All Implemented Interfaces:
DataParser
Direct Known Subclasses:
DoubleDataParser, FloatDataParser, IntegerDataParser, LongDataParser

public abstract class NumericDataParser
extends java.lang.Object
implements DataParser

Generic data parser for numeric data


Constructor Summary
NumericDataParser()
          Create a new numeric data parser
NumericDataParser(boolean first_column_date)
          Create a new numeric data parser, with the information that the first column is in date format.
 
Method Summary
protected abstract  boolean checkNumberFormat(java.lang.String format)
          Check whether this String represents a number
 boolean isValid(java.lang.String data, int index)
          Check whether a data value with a specific index number is valid or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericDataParser

public NumericDataParser()
Create a new numeric data parser


NumericDataParser

public NumericDataParser(boolean first_column_date)
Create a new numeric data parser, with the information that the first column is in date format.

Parameters:
first_column_date - Whether the first column is in date format
Method Detail

isValid

public boolean isValid(java.lang.String data,
                       int index)
Check whether a data value with a specific index number is valid or not

Specified by:
isValid in interface DataParser
Parameters:
data - The numerical data to check
index - The index of the specified data
Returns:
True, if the data is valid.

checkNumberFormat

protected abstract boolean checkNumberFormat(java.lang.String format)
Check whether this String represents a number

Parameters:
format - the String containing the number
Returns:
True, if this is a representation of a number