Class LazyOrderedSet.SubOrderedSet<E>

  • Type Parameters:
    E - the collection element type
    All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.Set<E>
    Enclosing class:
    LazyOrderedSet<E>

    public static class LazyOrderedSet.SubOrderedSet<E>
    extends LazyOrderedSet.NonCachingOrderedSet<E>
    LazyOrderedSet that represents a sub-range of the underlying LazyOrderedSet. Index starts at 0.
    • Field Detail

      • fromIndex

        protected final int fromIndex
      • toIndex

        protected final int toIndex
    • Constructor Detail

      • SubOrderedSet

        public SubOrderedSet​(int fromIndex,
                             int toIndex,
                             LazyOrderedSet<E> dataSource)
        Parameters:
        fromIndex - the starting index, inclusive
        toIndex - the ending index, exclusive
        dataSource - the underlying collection
    • Method Detail

      • first

        public E first()
        Returns the first element in self.
        Overrides:
        first in class LazyOrderedSet<E>
        Returns:
        The first element in self.
      • last

        public E last()
        Returns the last element in self.
        Overrides:
        last in class LazyOrderedSet<E>
        Returns:
        The last element in self.
      • get

        public E get​(int index)
        Specified by:
        get in interface java.util.List<E>
        Overrides:
        get in class LazyOrderedSet<E>
      • indexOf

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<E>
        Overrides:
        indexOf in class LazyOrderedSet<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.List<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.List<E>
        Specified by:
        isEmpty in interface java.util.Set<E>
        Overrides:
        isEmpty in class LazyCollection<E>
      • 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.List<E>
        Specified by:
        iterator in interface java.util.Set<E>
        Overrides:
        iterator in class LazyOrderedSet<E>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.List<E>
        Specified by:
        size in interface java.util.Set<E>
        Overrides:
        size in class LazyCollection<E>
      • listIterator

        public java.util.ListIterator<E> listIterator()
        Specified by:
        listIterator in interface java.util.List<E>
        Overrides:
        listIterator in class LazyOrderedSet<E>
      • listIterator

        public java.util.ListIterator<E> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<E>
        Overrides:
        listIterator in class LazyOrderedSet<E>