Class LazySet.ExcludingSet<E>

  • Type Parameters:
    E - the collection element type
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>
    Enclosing class:
    LazySet<E>

    public static class LazySet.ExcludingSet<E>
    extends LazySet.NonCachingSet<E>
    LazySet that excludes an element from the underlying LazySet.
    • Field Detail

      • object

        protected final java.lang.Object object
      • containsExcluded

        protected boolean containsExcluded
      • containsExcludedSet

        protected boolean containsExcludedSet
    • Constructor Detail

      • ExcludingSet

        public ExcludingSet​(java.lang.Object object,
                            LazySet<E> dataSource)
        Creates a new LazySet.ExcludingSet.
        Parameters:
        object - the element to exclude
        dataSource - the underlying collection
    • Method Detail

      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.Set<E>
        Overrides:
        contains in class LazyCollection<E>
      • count

        public int count​(java.lang.Object o)
        Returns the number of occurrences of object in self.
        post: result <= 1
        Overrides:
        count in class LazySet<E>
        Parameters:
        o - the object to count
        Returns:
        The number of occurrences of object in self.
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<E>
        Specified by:
        isEmpty in interface java.util.Set<E>
        Overrides:
        isEmpty in class LazyCollection<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 interface java.util.Set<E>
        Overrides:
        iterator in class LazySet<E>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.Set<E>
        Overrides:
        size in class LazyCollection<E>