Class DoubleSequence

java.lang.Object
org.broadinstitute.hellbender.utils.dragstr.DoubleSequence

public final class DoubleSequence extends Object
User argument to specify a sequence of doubles with 3 values in the format "start:step:limit".

The start is the first values in the sequence. The

indicates the increment or decrement between consecutive values of the sequence

. And finally the limit indicates when the sequence stops; if increasing, when the next value exceeded the limit, if decreases when next value subceeds the limit

. The sequence is inclusive as far as the limit.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Pattern
    Currently the only supported format for the string descriptor is: start:step:end.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DoubleSequence(String descriptor)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    get(int index)
    Returns an element of the sequence by its 0-base index.
     
    double
    max()
    Returns the maximum value of the sequence
    double
    min()
    Returns the minimum value of the sequence.
    long
    Number of elements in the sequence.
    double
    Returns the step in the sequence.
    double[]
    Returns a new double array containing the elements of the sequence in the same order.
    Return the original spec of the sequence

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • STEP_DECRIPTION_PATTERN

      public static final Pattern STEP_DECRIPTION_PATTERN
      Currently the only supported format for the string descriptor is: start:step:end.
  • Constructor Details

    • DoubleSequence

      public DoubleSequence(String descriptor)
  • Method Details

    • get

      public double get(int index)
      Returns an element of the sequence by its 0-base index.
      Parameters:
      index -
      Returns:
    • size

      public long size()
      Number of elements in the sequence.
      Returns:
      0 or greater.
    • toString

      public String toString()
      Return the original spec of the sequence
      Overrides:
      toString in class Object
      Returns:
    • min

      public double min()
      Returns the minimum value of the sequence.
      Returns:
      always a finite.
    • max

      public double max()
      Returns the maximum value of the sequence
      Returns:
      always a finite.
    • step

      public double step()
      Returns the step in the sequence.
      Returns:
      unspecified if the sequence has less than 2 elements, otherwise a finite.
    • toDoubleArray

      public double[] toDoubleArray()
      Returns a new double array containing the elements of the sequence in the same order.
      Returns:
      never , but perhaps an empty array.
    • getDescription

      public String getDescription()