Class SynchronizedCharIterable

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

    public class SynchronizedCharIterable
    extends java.lang.Object
    implements CharIterable, java.io.Serializable
    A synchronized view of a CharIterable. 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

      • SynchronizedCharIterable

        protected SynchronizedCharIterable​(CharIterable iterable)
      • SynchronizedCharIterable

        protected SynchronizedCharIterable​(CharIterable iterable,
                                           java.lang.Object newLock)
    • Method Detail

      • of

        public static SynchronizedCharIterable of​(CharIterable iterable,
                                                  java.lang.Object lock)
        This method will take a CharIterable and wrap it directly in a SynchronizedCharIterable. Additionally, a developer specifies which lock to use with the collection.
      • toArray

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

        public char[] toArray​(char[] target)
        Description copied from interface: CharIterable
        Converts the CharIterable to a primitive char 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 CharIterable
      • contains

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

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

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

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

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

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

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

        public CharIterable select​(CharPredicate predicate)
        Description copied from interface: CharIterable
        Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.
        Specified by:
        select in interface CharIterable
      • reject

        public CharIterable reject​(CharPredicate predicate)
        Description copied from interface: CharIterable
        Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.
        Specified by:
        reject in interface CharIterable
      • collect

        public <V> RichIterable<V> collect​(CharToObjectFunction<? extends V> function)
        Description copied from interface: CharIterable
        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 CharIterable
      • count

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

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

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

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

        public char maxIfEmpty​(char defaultValue)
        Specified by:
        maxIfEmpty in interface CharIterable
      • minIfEmpty

        public char minIfEmpty​(char defaultValue)
        Specified by:
        minIfEmpty in interface CharIterable
      • chunk

        public RichIterable<CharIterable> chunk​(int size)
        Description copied from interface: CharIterable
        Partitions elements in fixed size chunks.
        Specified by:
        chunk in interface CharIterable
        Parameters:
        size - the number of elements per chunk
        Returns:
        A RichIterable containing CharIterables 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.