Class AlwaysInvalidQueryList<T>

    • Constructor Detail

      • AlwaysInvalidQueryList

        public AlwaysInvalidQueryList​(long size)
        Constructor.
        Parameters:
        size - size of this list to report via size
        Throws:
        IllegalArgumentException - if size is negative
    • Method Detail

      • size

        public long size()
        Description copied from interface: QueryList
        Get the total size of this list.

        For any given QueryList instance, this method is expected to return a the same value if invoked multiple times. Therefore, callers may safely choose to invoke it only once on a given instance and cache the result.

        Specified by:
        size in interface QueryList<T>
        Returns:
        total size of list
      • get

        public T get​(long index)
              throws InvalidQueryListException
        Description copied from interface: QueryList
        Get an item in the list, or throw an exception if this instance is no longer valid or cannot provide the item.
        Specified by:
        get in interface QueryList<T>
        Parameters:
        index - index of the item (zero-based)
        Returns:
        the list item at index
        Throws:
        InvalidQueryListException - if this list has become invalid or cannot provide the item