Package uk.ac.rdg.resc.edal.util
Class Extents
- java.lang.Object
-
- uk.ac.rdg.resc.edal.util.Extents
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Comparable<? super T>>
Extent<T>emptyExtent()
static <T extends Comparable<? super T>>
Extent<T>findMinMax(Collection<T> coll)
Creates an Extent whose minimum is the lowest value in the passed collection and whose maximum is the highest value in the passed collection, according to the natural order of its elements.static <T extends Object & Comparable<? super T>>
Extent<T>newExtent(T min, T max)
-
-
-
Method Detail
-
findMinMax
public static <T extends Comparable<? super T>> Extent<T> findMinMax(Collection<T> coll)
Creates an Extent whose minimum is the lowest value in the passed collection and whose maximum is the highest value in the passed collection, according to the natural order of its elements. Null values and NaNs in the passed collection are ignored; if the collection consists entirely of null values the returned Extent will have null minimum and maximum values (an empty extent).- Type Parameters:
T
- The type of the elements in the collection- Parameters:
coll
- A Collection of values, in any order.- Returns:
- an Extent whose minimum is the lowest value in the passed collection and whose maximum is the highest value in the passed collection.
- Throws:
NullPointerException
- if the collection is nullNoSuchElementException
- if the collection is emptyClassCastException
- if any of the elements in the collection are notComparable
with any of the others.
-
newExtent
public static <T extends Object & Comparable<? super T>> Extent<T> newExtent(T min, T max)
-
emptyExtent
public static <T extends Comparable<? super T>> Extent<T> emptyExtent()
-
-