Class AbstractDoubleStack

    • Constructor Detail

      • AbstractDoubleStack

        public AbstractDoubleStack()
    • Method Detail

      • checkEmptyStack

        protected void checkEmptyStack()
      • peek

        public double peek()
        Description copied from interface: DoubleStack
        Returns the top of the stack.
        Specified by:
        peek in interface DoubleStack
      • peek

        public DoubleList peek​(int count)
        Description copied from interface: DoubleStack
        Returns DoubleList of the number of elements specified by the count, beginning with the top of the stack.
        Specified by:
        peek in interface DoubleStack
      • peekAt

        public double peekAt​(int index)
        Description copied from interface: DoubleStack
        Returns the element at the specified index.
        Specified by:
        peekAt in interface DoubleStack
        Parameters:
        index - the location to peek into
      • rangeCheck

        protected void rangeCheck​(int index)
      • checkPositiveValueForCount

        protected void checkPositiveValueForCount​(int count)
      • checkSizeLessThanCount

        protected void checkSizeLessThanCount​(int count)
      • count

        public int count​(DoublePredicate predicate)
        Description copied from interface: DoubleIterable
        Returns a count of the number of elements in the DoubleIterable that return true for the specified predicate.
        Specified by:
        count in interface DoubleIterable
      • anySatisfy

        public boolean anySatisfy​(DoublePredicate predicate)
        Description copied from interface: DoubleIterable
        Returns true if any of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.
        Specified by:
        anySatisfy in interface DoubleIterable
      • allSatisfy

        public boolean allSatisfy​(DoublePredicate predicate)
        Description copied from interface: DoubleIterable
        Returns true if all of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.
        Specified by:
        allSatisfy in interface DoubleIterable
      • noneSatisfy

        public boolean noneSatisfy​(DoublePredicate predicate)
        Description copied from interface: DoubleIterable
        Returns true if none of the elements in the DoubleIterable return true for the specified predicate, otherwise returns false.
        Specified by:
        noneSatisfy in interface DoubleIterable
      • toArray

        public double[] toArray()
        Description copied from interface: DoubleIterable
        Converts the DoubleIterable to a primitive double array.
        Specified by:
        toArray in interface DoubleIterable
      • toArray

        public double[] toArray​(double[] target)
        Description copied from interface: DoubleIterable
        Converts the DoubleIterable to a primitive double array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.
        Specified by:
        toArray in interface DoubleIterable
      • contains

        public boolean contains​(double value)
        Description copied from interface: DoubleIterable
        Returns true if the value is contained in the DoubleIterable, and false if it is not.
        Specified by:
        contains in interface DoubleIterable
      • containsAll

        public boolean containsAll​(double... source)
        Description copied from interface: DoubleIterable
        Returns true if all of the values specified in the source array are contained in the DoubleIterable, and false if they are not.
        Specified by:
        containsAll in interface DoubleIterable
      • containsAll

        public boolean containsAll​(DoubleIterable source)
        Description copied from interface: DoubleIterable
        Returns true if all of the values specified in the source DoubleIterable are contained in the DoubleIterable, and false if they are not.
        Specified by:
        containsAll in interface DoubleIterable
      • toString

        public java.lang.String toString()
        Description copied from interface: PrimitiveIterable
        Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.
         Assert.assertEquals("[]", IntLists.mutable.empty().toString());
         Assert.assertEquals("[1]", IntLists.mutable.with(1).toString());
         Assert.assertEquals("[1, 2, 3]", IntLists.mutable.with(1, 2, 3).toString());
         
        Specified by:
        toString in interface PrimitiveIterable
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this PrimitiveIterable
        See Also:
        AbstractCollection.toString()
      • makeString

        public java.lang.String makeString()
        Description copied from interface: PrimitiveIterable
        Returns a string representation of this collection by delegating to PrimitiveIterable.makeString(String) and defaulting the separator parameter to the characters ", " (comma and space).
        Specified by:
        makeString in interface PrimitiveIterable
        Returns:
        a string representation of this collection.
      • makeString

        public java.lang.String makeString​(java.lang.String start,
                                           java.lang.String separator,
                                           java.lang.String end)
        Description copied from interface: PrimitiveIterable
        Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.
        Specified by:
        makeString in interface PrimitiveIterable
        Returns:
        a string representation of this collection.
      • chunk

        public RichIterable<DoubleIterable> chunk​(int size)
        Description copied from interface: DoubleIterable
        Partitions elements in fixed size chunks.
        Specified by:
        chunk in interface DoubleIterable
        Parameters:
        size - the number of elements per chunk
        Returns:
        A RichIterable containing DoubleIterables of size size, except the last will be truncated if the elements don't divide evenly.