* Converts the discrete function to string.
*/
public String toString()
{
StringBuffer text = new StringBuffer();
FlexibleDecimalFormat nf1 = new FlexibleDecimalFormat( 5 );
nf1.grouping( true );
FlexibleDecimalFormat nf2 = new FlexibleDecimalFormat( 5 );
nf2.grouping( true );
for(int i = 0; i < size(); i++) {
nf1.update( points.get(i) );
nf2.update( values.get(i) );
}
text.append("\t" + nf1.formatString("Points") +
"\t" + nf2.formatString("Values") + "\n\n");
for(int i = 0; i <= size() - 1; i++) {
text.append( "\t" + nf1.format( points.get(i) ) + "\t" +
nf2.format( values.get(i) ) + "\n" );
}
return text.toString();
}