Interface CharCollection

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean add​(char v)
      Adds an element to this collection.
      boolean addAll​(CharCollection c)
      Adds all the elements of a specified collection to this collection.
      void clear()
      Clears this collection.
      boolean contains​(char v)
      Indicates whether this collection contains a specified element.
      boolean containsAll​(CharCollection c)
      Indicates whether all elements of a specified collection is contained in this collection.
      boolean equals​(java.lang.Object obj)
      Indicates whether this collection is equal to some object.
      int hashCode()
      Returns a hash code value for this collection.
      boolean isEmpty()
      Indicates whether this collection is empty.
      CharIterator iterator()
      Returns an iterator over this collection.
      boolean remove​(char v)
      Removes a specified element from this collection.
      boolean removeAll​(CharCollection c)
      Removes all the elements of a specified collection from this collection.
      boolean retainAll​(CharCollection c)
      Retains only the elements of a specified collection in this collection.
      int size()
      Returns the number of elements in this collection.
      char[] toArray()
      Returns the elements of this collection as an array.
      char[] toArray​(char[] a)
      Returns the elements of this collection as an array.
      void trimToSize()
      Minimizes the memory used by this collection.
    • Method Detail

      • add

        boolean add​(char v)
        Adds an element to this collection.
        Parameters:
        v - the element to add to this collection.
        Returns:
        true if this collection was modified as a result of adding v; returns false otherwise.
        Throws:
        java.lang.UnsupportedOperationException - if the operation is not supported by this collection.
        See Also:
        addAll(CharCollection)
      • addAll

        boolean addAll​(CharCollection c)
        Adds all the elements of a specified collection to this collection.
        Parameters:
        c - the collection whose elements to add to this collection.
        Returns:
        true if this collection was modified as a result of adding the elements of c; returns false otherwise.
        Throws:
        java.lang.UnsupportedOperationException - if the operation is not supported by this collection.
        java.lang.NullPointerException - if c is null.
        See Also:
        add(char)
      • clear

        void clear()
        Clears this collection.
        Throws:
        java.lang.UnsupportedOperationException - if the operation is not supported by this collection.
      • contains

        boolean contains​(char v)
        Indicates whether this collection contains a specified element.
        Parameters:
        v - the element to test for containment.
        Returns:
        true if v is contained in this collection; returns false otherwise.
        See Also:
        containsAll(CharCollection)
      • containsAll

        boolean containsAll​(CharCollection c)
        Indicates whether all elements of a specified collection is contained in this collection.
        Parameters:
        c - the collection whose elements to test for containment.
        Returns:
        true if all the elements of c are contained in this collection; returns false otherwise.
        Throws:
        java.lang.NullPointerException - if c is null.
        See Also:
        contains(char)
      • equals

        boolean equals​(java.lang.Object obj)
        Indicates whether this collection is equal to some object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object with which to compare this collection.
        Returns:
        true if this collection is equals to obj; returns false otherwise.
      • hashCode

        int hashCode()
        Returns a hash code value for this collection.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        a hash code value for this collection.
      • isEmpty

        boolean isEmpty()
        Indicates whether this collection is empty.
        Returns:
        true if this collection is empty; returns false otherwise.
      • iterator

        CharIterator iterator()
        Returns an iterator over this collection.
        Returns:
        an iterator over this collection.
      • remove

        boolean remove​(char v)
        Removes a specified element from this collection.
        Parameters:
        v - the char value to remove from this collection.
        Returns:
        true if this collection was modified as a result of removing v; returns false otherwise.
        Throws:
        java.lang.UnsupportedOperationException - if the operation is not supported by this collection.
      • removeAll

        boolean removeAll​(CharCollection c)
        Removes all the elements of a specified collection from this collection.
        Parameters:
        c - the collection whose elements to remove from this collection.
        Returns:
        true if this collection was modified as a result of removing the elements of c; returns false otherwise.
        Throws:
        java.lang.UnsupportedOperationException - if the operation is not supported by this collection.
        java.lang.NullPointerException - if c is null.
      • retainAll

        boolean retainAll​(CharCollection c)
        Retains only the elements of a specified collection in this collection.
        Parameters:
        c - the collection whose elements to retain in this collection.
        Returns:
        true if this collection was modified as a result of removing the elements not contained in c; returns false otherwise.
        Throws:
        java.lang.UnsupportedOperationException - if the operation is not supported by this collection.
        java.lang.NullPointerException - if c is null.
      • size

        int size()
        Returns the number of elements in this collection.
        Returns:
        the number of elements in this collection.
      • toArray

        char[] toArray()
        Returns the elements of this collection as an array.
        Returns:
        a new array containing the elements of this collection.
      • toArray

        char[] toArray​(char[] a)
        Returns the elements of this collection as an array.
        Parameters:
        a - an array to fill with the elements of this collection; if a is null or not big enough to contain all the elements of this collection, an new array is allocated, and a is not changed.
        Returns:
        a, if a has room for all the elements of this collection; otherwise a new array is allocated, filled with the elements of this collection, and returned.
      • trimToSize

        void trimToSize()
        Minimizes the memory used by this collection. The exact operation of this method depends on the class implementing it. Implementors may choose to ignore it completely.