Documentation of 'visad.data.in.ArithProg' Java class
ArithProg
visad.data.in

Class ArithProg

  • Direct Known Subclasses:
    LonArithProg


    public class ArithProg
    extends java.lang.Object
    Provides support for determining if a sequence of numeric values corresponds to an arithmetic progression and, if so, the progression parameters.
    • Constructor Summary

      Constructors 
      Constructor and Description
      ArithProg() 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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(java.lang.String[] args) 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ArithProg

        public ArithProg()
    • Method Detail

      • accumulate

        public boolean accumulate(float[] values)
                           throws VisADException
        Accumulates a set of floats. Indicates whether or not the sequence is consistent with the arithmetic progression so far.
        Parameters:
        values - The values to accumulate.
        Returns:
        False if the difference between any current and previous value normalized by the current increment differs from unity by more than the nearness threshold; otherwise, true.
        Throws:
        VisADException - isConsistent() was false before this method was invoked.
      • accumulate

        public boolean accumulate(double[] values)
                           throws VisADException
        Accumulates a set of doubles. Indicates whether or not the sequence is consistent with the arithmetic progression so far.
        Parameters:
        values - The values to accumulate.
        Returns:
        False if the difference between any current and previous value normalized by the current increment differs from unity by more than the nearness threshold; otherwise, true.
        Throws:
        VisADException - isConsistent() was false before this method was invoked.
      • accumulate

        public final boolean accumulate(float value)
                                 throws VisADException
        Accumulates a value. Indicate whether or not the value is consistent with the arithmetic progression so far.
        Parameters:
        value - The value to accumulate.
        Returns:
        False if the difference between any current and previous value normalized by the current increment differs from unity by more than the nearness threshold; otherwise, true.
        Throws:
        VisADException - The sequence isn't an arithmetic progression.
      • accumulate

        public final boolean accumulate(double value)
                                 throws VisADException
        Accumulates a value. Indicate whether or not the value is consistent with the arithmetic progression so far.
        Parameters:
        value - The value to accumulate.
        Returns:
        False if the difference between any current and previous value normalized by the current increment differs from unity by more than the nearness threshold; otherwise, true.
        Throws:
        VisADException - The sequence isn't an arithmetic progression.
      • isConsistent

        public final boolean isConsistent()
        Indicates whether or not the sequence so far is consistent with an arithmetic progression.
        Returns:
        true if and only if the sequence of values seen so far is consistent with an arithmetic progression.
      • getNumber

        public final long getNumber()
                             throws VisADException
        Gets the number of values. Only meaningfull if isConsistent() is true.
        Returns:
        The number of values accumulated so far.
        Throws:
        VisADException - The sequence isn't an arithmetic progression.
      • getFirst

        public final double getFirst()
                              throws VisADException
        Gets the first value.
        Returns:
        The first accumulated value.
        Throws:
        VisADException - The sequence isn't an arithmetic progression.
      • getLast

        public final double getLast()
                             throws VisADException
        Returns the "last" value accumulated. It is only meaningfull if isConsistent is true.
        Returns:
        The last accumulated value.
        Throws:
        VisADException - The sequence isn't an arithmetic progression.
      • getCommonDifference

        public final double getCommonDifference()
                                         throws VisADException
        Gets the current common difference. Only meaningfull if isConsistent() is true.
        Returns:
        The computed common difference so far.
        Throws:
        VisADException - The sequence isn't an arithmetic progression.
      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.