Class SynchronizedDoubleIterable

  • All Implemented Interfaces:
    java.io.Serializable, DoubleIterable, PrimitiveIterable

    public class SynchronizedDoubleIterable
    extends java.lang.Object
    implements DoubleIterable, java.io.Serializable
    A synchronized view of a DoubleIterable. This file was automatically generated from template file synchronizedPrimitiveIterable.stg.
    Since:
    5.0.
    See Also:
    Serialized Form
    • Field Detail

      • lock

        private final java.lang.Object lock
    • Constructor Detail

      • SynchronizedDoubleIterable

        protected SynchronizedDoubleIterable​(DoubleIterable iterable)
      • SynchronizedDoubleIterable

        protected SynchronizedDoubleIterable​(DoubleIterable iterable,
                                             java.lang.Object newLock)
    • Method Detail

      • of

        public static SynchronizedDoubleIterable of​(DoubleIterable iterable,
                                                    java.lang.Object lock)
        This method will take a DoubleIterable and wrap it directly in a SynchronizedDoubleIterable. Additionally, a developer specifies which lock to use with the collection.
      • 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
      • containsAny

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

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

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

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

        public <V> RichIterable<V> collect​(DoubleToObjectFunction<? extends V> function)
        Description copied from interface: DoubleIterable
        Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.
        Specified by:
        collect in interface DoubleIterable
      • 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
      • 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.
      • 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.