net.moioli.drawables
Class ParsedSeries

java.lang.Object
  extended by net.moioli.drawables.AbstractDrawableSuccession
      extended by net.moioli.drawables.ParsedSuccession
          extended by net.moioli.drawables.ParsedSeries
All Implemented Interfaces:
DrawableI, SuccessionI

public class ParsedSeries
extends ParsedSuccession

A convenient way to implement series, that is, defining them with a string that will be parsed.

Version:
2005/10/5
Author:
Silvio Moioli
See Also:
ParsedFunction

Constructor Summary
ParsedSeries(int min, java.lang.String s)
          Standard constructor.
 
Method Summary
 double f(int n)
          Returns the y value corresponding to the specified index n.
 
Methods inherited from class net.moioli.drawables.AbstractDrawableSuccession
drawMe, maxY, minY, safeF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsedSeries

public ParsedSeries(int min,
                    java.lang.String s)
             throws org.nfunk.jep.ParseException
Standard constructor.

Parameters:
min - the minimum index of the series
s - the string to be parsed
Throws:
org.nfunk.jep.ParseException - if the string couldn't be parsed correctly
See Also:
ParsedFunction, JEP
Method Detail

f

public double f(int n)
Returns the y value corresponding to the specified index n.

Specified by:
f in interface SuccessionI
Overrides:
f in class ParsedSuccession
Parameters:
n - the non-negative integer index
Returns:
the value of the succession