Class LazySet.LongRangeSet

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Long>, java.util.Collection<java.lang.Long>, java.util.Set<java.lang.Long>
    Enclosing class:
    LazySet<E>

    public static class LazySet.LongRangeSet
    extends LazySet<java.lang.Long>
    LazySet that represents a range running from a first to last Long.
    • Field Detail

      • first

        protected final long first
      • last

        protected final long last
    • Constructor Detail

      • LongRangeSet

        public LongRangeSet​(long first,
                            long last)
        Creates a new LazyBag.LongRangeBag.
        Parameters:
        first - the first object of the range to include
        last - the last object of the range to include
    • Method Detail

      • createCache

        protected void createCache()
        Creates the cache collections.
        Overrides:
        createCache in class LazySet<java.lang.Long>
      • contains

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

        public int count​(java.lang.Object object)
        Returns the number of occurrences of object in self.
        post: result <= 1
        Overrides:
        count in class LazySet<java.lang.Long>
        Parameters:
        object - 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<java.lang.Long>
        Specified by:
        isEmpty in interface java.util.Set<java.lang.Long>
        Overrides:
        isEmpty in class LazyCollection<java.lang.Long>
      • iterator

        public java.util.Iterator<java.lang.Long> iterator()
        Specified by:
        iterator in interface java.util.Collection<java.lang.Long>
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Long>
        Specified by:
        iterator in interface java.util.Set<java.lang.Long>
        Overrides:
        iterator in class LazySet<java.lang.Long>
      • size

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