org.dellroad.stuff.vaadin7.AlwaysInvalidQueryList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dellroad-stuff-vaadin7 Show documentation
Show all versions of dellroad-stuff-vaadin7 Show documentation
DellRoad Stuff classes related to the Vaadin GUI framework.
/*
* Copyright (C) 2011 Archie L. Cobbs. All rights reserved.
*/
package org.dellroad.stuff.vaadin7;
/**
* A {@link QueryList} that always throws {@link InvalidQueryListException}.
*/
public class AlwaysInvalidQueryList implements QueryList {
private final long size;
/**
* Constructor.
*
* @param size size of this list to report via {@link #size}
* @throws IllegalArgumentException if {@code size} is negative
*/
public AlwaysInvalidQueryList(long size) {
if (size < 0)
throw new IllegalArgumentException("size < 0");
this.size = size;
}
public long size() {
return this.size;
}
public T get(long index) throws InvalidQueryListException {
throw new InvalidQueryListException();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy