|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visad.data.in.ArithProg
public class ArithProg
Provides support for determining if a sequence of numeric values corresponds to an arithmetic progression and, if so, the progression parameters.
Field Summary | |
---|---|
protected double |
dEps
|
protected double |
fEps
|
protected double |
first
|
protected boolean |
isConsistent
|
protected double |
last
|
protected double |
meanDel
|
protected long |
n
|
Constructor Summary | |
---|---|
ArithProg()
|
Method Summary | |
---|---|
boolean |
accumulate(double value)
Accumulates a value. |
boolean |
accumulate(double[] values)
Accumulates a set of doubles. |
boolean |
accumulate(float value)
Accumulates a value. |
boolean |
accumulate(float[] values)
Accumulates a set of floats. |
double |
getCommonDifference()
Gets the current common difference. |
double |
getFirst()
Gets the first value. |
double |
getLast()
Returns the "last" value accumulated. |
long |
getNumber()
Gets the number of values. |
boolean |
isConsistent()
Indicates whether or not the sequence so far is consistent with an arithmetic progression. |
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long n
protected double first
protected double last
protected double meanDel
protected boolean isConsistent
protected final double fEps
protected final double dEps
Constructor Detail |
---|
public ArithProg()
Method Detail |
---|
public boolean accumulate(float[] values) throws VisADException
values
- The values to accumulate.
VisADException
- isConsistent()
was false before this
method was invoked.values.length
more than previously
if the function returns true., A subsequent getLast() will return the
value argument if the function returns true.public boolean accumulate(double[] values) throws VisADException
values
- The values to accumulate.
VisADException
- isConsistent()
was false before this
method was invoked.values.length
more than previously
if the function returns true., A subsequent getLast() will return the
value argument if the function returns true.public final boolean accumulate(float value) throws VisADException
value
- The value to accumulate.
VisADException
- The sequence isn't an arithmetic progression.values.length
more than previously
if the function returns true., A subsequent getLast() will return the
value argument if the function returns true.public final boolean accumulate(double value) throws VisADException
value
- The value to accumulate.
VisADException
- The sequence isn't an arithmetic progression.values.length
more than previously
if the function returns true., A subsequent getLast() will return the
value argument if the function returns true.public final boolean isConsistent()
true
if and only if the sequence
of values seen so far is consistent with an
arithmetic progression.public final long getNumber() throws VisADException
isConsistent()
is true.
VisADException
- The sequence isn't an arithmetic progression.public final double getFirst() throws VisADException
VisADException
- The sequence isn't an arithmetic progression.public final double getLast() throws VisADException
isConsistent
is true.
VisADException
- The sequence isn't an arithmetic progression.public final double getCommonDifference() throws VisADException
isConsistent()
is true.
VisADException
- The sequence isn't an arithmetic progression.public static void main(String[] args) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |