Class LazySet.IntegerRangeSet

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

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

      • first

        protected final int first
      • last

        protected final int last
    • Constructor Detail

      • IntegerRangeSet

        public IntegerRangeSet​(int first,
                               int last)
        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.Integer>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<java.lang.Integer>
        Specified by:
        contains in interface java.util.Set<java.lang.Integer>
        Overrides:
        contains in class LazyCollection<java.lang.Integer>
      • 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.Integer>
        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.Integer>
        Specified by:
        isEmpty in interface java.util.Set<java.lang.Integer>
        Overrides:
        isEmpty in class LazyCollection<java.lang.Integer>
      • iterator

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

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