Class Collections2.FilteredCollection<E>

  • All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>
    Direct Known Subclasses:
    Sets.FilteredSet
    Enclosing class:
    Collections2

    static class Collections2.FilteredCollection<E>
    extends java.util.AbstractCollection<E>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) Predicate<? super E> predicate  
      (package private) java.util.Collection<E> unfiltered  
    • Constructor Summary

      Constructors 
      Constructor Description
      FilteredCollection​(java.util.Collection<E> unfiltered, Predicate<? super E> predicate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(E element)  
      boolean addAll​(java.util.Collection<? extends E> collection)  
      void clear()  
      boolean contains​(java.lang.Object element)  
      boolean containsAll​(java.util.Collection<?> collection)  
      (package private) Collections2.FilteredCollection<E> createCombined​(Predicate<? super E> newPredicate)  
      void forEach​(java.util.function.Consumer<? super E> action)  
      boolean isEmpty()  
      java.util.Iterator<E> iterator()  
      boolean remove​(java.lang.Object element)  
      boolean removeAll​(java.util.Collection<?> collection)  
      boolean removeIf​(java.util.function.Predicate<? super E> filter)  
      boolean retainAll​(java.util.Collection<?> collection)  
      int size()  
      java.util.Spliterator<E> spliterator()  
      java.lang.Object[] toArray()  
      <T> T[] toArray​(T[] array)  
      • Methods inherited from class java.util.AbstractCollection

        toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        equals, hashCode, parallelStream, stream, toArray
    • Field Detail

      • unfiltered

        final java.util.Collection<E> unfiltered
    • Constructor Detail

      • FilteredCollection

        FilteredCollection​(java.util.Collection<E> unfiltered,
                           Predicate<? super E> predicate)
    • Method Detail

      • add

        public boolean add​(E element)
        Specified by:
        add in interface java.util.Collection<E>
        Overrides:
        add in class java.util.AbstractCollection<E>
      • addAll

        public boolean addAll​(java.util.Collection<? extends E> collection)
        Specified by:
        addAll in interface java.util.Collection<E>
        Overrides:
        addAll in class java.util.AbstractCollection<E>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
        Overrides:
        clear in class java.util.AbstractCollection<E>
      • contains

        public boolean contains​(@CheckForNull
                                java.lang.Object element)
        Specified by:
        contains in interface java.util.Collection<E>
        Overrides:
        contains in class java.util.AbstractCollection<E>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> collection)
        Specified by:
        containsAll in interface java.util.Collection<E>
        Overrides:
        containsAll in class java.util.AbstractCollection<E>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<E>
        Overrides:
        isEmpty in class java.util.AbstractCollection<E>
      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in class java.util.AbstractCollection<E>
      • spliterator

        public java.util.Spliterator<E> spliterator()
      • forEach

        public void forEach​(java.util.function.Consumer<? super E> action)
      • remove

        public boolean remove​(@CheckForNull
                              java.lang.Object element)
        Specified by:
        remove in interface java.util.Collection<E>
        Overrides:
        remove in class java.util.AbstractCollection<E>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> collection)
        Specified by:
        removeAll in interface java.util.Collection<E>
        Overrides:
        removeAll in class java.util.AbstractCollection<E>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> collection)
        Specified by:
        retainAll in interface java.util.Collection<E>
        Overrides:
        retainAll in class java.util.AbstractCollection<E>
      • removeIf

        public boolean removeIf​(java.util.function.Predicate<? super E> filter)
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in class java.util.AbstractCollection<E>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<E>
        Overrides:
        toArray in class java.util.AbstractCollection<E>
      • toArray

        public <T> T[] toArray​(T[] array)
        Specified by:
        toArray in interface java.util.Collection<E>
        Overrides:
        toArray in class java.util.AbstractCollection<E>