Class LazySetOnSet<E>

  • Type Parameters:
    E -
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

    public class LazySetOnSet<E>
    extends LazySet<E>
    LazySet that passes method calls through to the underlying Set, where possible, instead of going via Iterators.
    • Constructor Detail

      • LazySetOnSet

        public LazySetOnSet​(java.util.Set<E> dataSource)
        Creates a new LazySetOnSet around dataSource.
        Parameters:
        dataSource - the underlying collection
    • Method Detail

      • 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>
      • 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>
      • 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>
      • 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>