Package blbutil

Class DoubleArray


  • public class DoubleArray
    extends java.lang.Object
    Class DoubleArray represents an immutable list of double floating point values.
    • Constructor Summary

      Constructors 
      Constructor Description
      DoubleArray​(double[] values)
      Constructs an DoubleArray object with the specified values.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double get​(int index)
      Returns the double at the specified position in this list.
      boolean isEmpty()
      Returns true if this list has no elements, and returns false otherwise.
      int size()
      Returns the number of elements in this list.
      double[] toArray()
      Returns an integer array containing the sequence of elements in this list.
      java.lang.String toString()
      Returns a string representation of this list that is obtained by calling java.util.Arrays.toString(this.toArray()).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DoubleArray

        public DoubleArray​(double[] values)
        Constructs an DoubleArray object with the specified values.
        Parameters:
        values - the list of floating point values
        Throws:
        java.lang.NullPointerException - if values == null
    • Method Detail

      • get

        public double get​(int index)
        Returns the double at the specified position in this list.
        Parameters:
        index - the index of the returned double
        Returns:
        the double at the specified position in this list
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >= this.size()
      • size

        public int size()
        Returns the number of elements in this list.
        Returns:
        the number of elements in this list
      • isEmpty

        public boolean isEmpty()
        Returns true if this list has no elements, and returns false otherwise.
        Returns:
        true if this list has no elements, and returns false otherwise
      • toArray

        public double[] toArray()
        Returns an integer array containing the sequence of elements in this list.
        Returns:
        an integer array containing the sequence of elements in this list
      • toString

        public java.lang.String toString()
        Returns a string representation of this list that is obtained by calling java.util.Arrays.toString(this.toArray()).
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this list