Class LazyBag.IntegerRangeBag

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

    public static class LazyBag.IntegerRangeBag
    extends LazyBag<java.lang.Integer>
    LazyBag 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

      • IntegerRangeBag

        public IntegerRangeBag​(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 LazyBag<java.lang.Integer>
      • contains

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

        public int count​(java.lang.Object object)
        Returns the number of times that object occurs in the collection self.
        Overrides:
        count in class LazyCollection<java.lang.Integer>
        Parameters:
        object - the object to check for
        Returns:
        The number of times that object occurs in the collection self.
      • isEmpty

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

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