Class LazyBag.LongRangeBag

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

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

      • LongRangeBag

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

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

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