Package org.dellroad.stuff.vaadin7
Class AlwaysInvalidQueryList<T>
- java.lang.Object
-
- org.dellroad.stuff.vaadin7.AlwaysInvalidQueryList<T>
-
- All Implemented Interfaces:
QueryList<T>
public class AlwaysInvalidQueryList<T> extends Object implements QueryList<T>
AQueryListthat always throwsInvalidQueryListException.
-
-
Constructor Summary
Constructors Constructor Description AlwaysInvalidQueryList(long size)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget(long index)Get an item in the list, or throw an exception if this instance is no longer valid or cannot provide the item.longsize()Get the total size of this list.
-
-
-
Constructor Detail
-
AlwaysInvalidQueryList
public AlwaysInvalidQueryList(long size)
Constructor.- Parameters:
size- size of this list to report viasize- Throws:
IllegalArgumentException- ifsizeis negative
-
-
Method Detail
-
size
public long size()
Description copied from interface:QueryListGet the total size of this list.For any given
QueryListinstance, 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.
-
get
public T get(long index) throws InvalidQueryListException
Description copied from interface:QueryListGet an item in the list, or throw an exception if this instance is no longer valid or cannot provide the item.- Specified by:
getin interfaceQueryList<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
-
-