Class AtomicDoubleArray


  • public class AtomicDoubleArray
    extends java.lang.Object
    Atomic double Array implementation
    • Constructor Summary

      Constructors 
      Constructor Description
      AtomicDoubleArray​(int capacity)
      Create a new AtomicDoubleArray
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, double value)
      add argument to value at index.
      void clear()
      set all elements to 0
      double get​(int index)
      get the value at index
      int length()
      return capacity
      void set​(int index, double value)
      Sets the element at position i to the given value.
      double[] toArray()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • AtomicDoubleArray

        public AtomicDoubleArray​(int capacity)
        Create a new AtomicDoubleArray
        Parameters:
        capacity - its capacity
    • Method Detail

      • get

        public double get​(int index)
        get the value at index
        Parameters:
        index - the index
        Returns:
        value at index
      • set

        public void set​(int index,
                        double value)
        Sets the element at position i to the given value.
        Parameters:
        index - the index
        value - the value
      • add

        public void add​(int index,
                        double value)
        add argument to value at index. Behaves exactly like standard java double arithmetic.
        Parameters:
        index - index
        value - value to add
      • length

        public int length()
        return capacity
        Returns:
        the capacity
      • clear

        public void clear()
        set all elements to 0
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toArray

        public double[] toArray()