org.osm2world.core.util
Class MinMaxUtil

Object
  extended by MinMaxUtil

public final class MinMaxUtil
extends Object


Method Summary
static
<T> T
max(Iterable<T> objects, Function<T,Double> f)
          from an Iterable of objects, this returns the one with the highest associated value of a function f
static
<T> T
min(Iterable<T> objects, Function<T,Double> f)
          from an Iterable of objects, this returns the one with the lowest associated value of a function f
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

min

public static final <T> T min(Iterable<T> objects,
                              Function<T,Double> f)
from an Iterable of objects, this returns the one with the lowest associated value of a function f

Returns:
any of the inputs that generate the minimum function value, null if objects is empty

max

public static final <T> T max(Iterable<T> objects,
                              Function<T,Double> f)
from an Iterable of objects, this returns the one with the highest associated value of a function f

Returns:
any of the inputs that generate the maximum function value, null if objects is empty