Class Extents


  • public final class Extents
    extends Object
    Contains convenience methods for creating Extent objects. This class is non-instantiable.
    Author:
    Guy, Jon
    • 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 null
        NoSuchElementException - if the collection is empty
        ClassCastException - if any of the elements in the collection are not Comparable 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()