Class Agg


  • public class Agg
    extends java.lang.Object
    Aggregates (e.g. min/max), with null-safety!
    Author:
    jjlauer
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Agg.Max<T>  
      static class  Agg.Min<T>  
      static class  Agg.OrderedValue<T>  
    • Constructor Summary

      Constructors 
      Constructor Description
      Agg()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V extends java.lang.Comparable>
      Agg.Max<V>
      max()
      Helps aggregate the max value according to natural ordering of the type.
      static <V extends java.lang.Comparable>
      Agg.Max<V>
      max​(java.lang.Class<V> type)
      Helps aggregate the max value according to natural ordering of the type.
      static <V> Agg.Max<V> max​(java.util.Comparator<V> comparator)
      Helps aggregate the max value.
      static <V> Agg.Max<V> max​(java.util.Comparator<V> comparator, V initialValue)
      Helps aggregate the max value.
      static <V extends java.lang.Comparable>
      Agg.Max<V>
      max​(V initialValue)
      Helps aggregate the max value according to the natural ordering of the type of initial value.
      static <V extends java.lang.Comparable>
      Agg.Min<V>
      min()
      Helps aggregate the min value according to natural ordering of the type.
      static <V extends java.lang.Comparable>
      Agg.Min<V>
      min​(java.lang.Class<V> type)
      Helps aggregate the min value according to natural ordering of the type.
      static <V> Agg.Min<V> min​(java.util.Comparator<V> comparator)
      Helps aggregate the min value.
      static <V> Agg.Min<V> min​(java.util.Comparator<V> comparator, V initialValue)
      Helps aggregate the min value.
      static <V extends java.lang.Comparable>
      Agg.Min<V>
      min​(V initialValue)
      Helps aggregate the min value according to the natural ordering of the type of initial value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Agg

        public Agg()
    • Method Detail

      • min

        public static <V extends java.lang.Comparable> Agg.Min<V> min()
        Helps aggregate the min value according to natural ordering of the type.
        Type Parameters:
        V -
        Returns:
      • min

        public static <V extends java.lang.Comparable> Agg.Min<V> min​(java.lang.Class<V> type)
        Helps aggregate the min value according to natural ordering of the type.
        Type Parameters:
        V -
        Parameters:
        type -
        Returns:
      • min

        public static <V extends java.lang.Comparable> Agg.Min<V> min​(V initialValue)
        Helps aggregate the min value according to the natural ordering of the type of initial value.
        Type Parameters:
        V -
        Parameters:
        initialValue -
        Returns:
      • min

        public static <V> Agg.Min<V> min​(java.util.Comparator<V> comparator)
        Helps aggregate the min value. Comparator is the natural ordering of values such that 1 < 2.
        Type Parameters:
        V -
        Parameters:
        comparator -
        Returns:
      • min

        public static <V> Agg.Min<V> min​(java.util.Comparator<V> comparator,
                                         V initialValue)
        Helps aggregate the min value. Comparator is the natural ordering of values such that 1 < 2.
        Type Parameters:
        V -
        Parameters:
        comparator -
        initialValue -
        Returns:
      • max

        public static <V extends java.lang.Comparable> Agg.Max<V> max()
        Helps aggregate the max value according to natural ordering of the type.
        Type Parameters:
        V -
        Returns:
      • max

        public static <V extends java.lang.Comparable> Agg.Max<V> max​(java.lang.Class<V> type)
        Helps aggregate the max value according to natural ordering of the type.
        Type Parameters:
        V -
        Parameters:
        type -
        Returns:
      • max

        public static <V extends java.lang.Comparable> Agg.Max<V> max​(V initialValue)
        Helps aggregate the max value according to the natural ordering of the type of initial value.
        Type Parameters:
        V -
        Parameters:
        initialValue -
        Returns:
      • max

        public static <V> Agg.Max<V> max​(java.util.Comparator<V> comparator)
        Helps aggregate the max value. Comparator is the natural ordering of values such that 1 < 2.
        Type Parameters:
        V -
        Parameters:
        comparator -
        Returns:
      • max

        public static <V> Agg.Max<V> max​(java.util.Comparator<V> comparator,
                                         V initialValue)
        Helps aggregate the max value. Comparator is the natural ordering of values such that 1 < 2.
        Type Parameters:
        V -
        Parameters:
        comparator -
        initialValue -
        Returns: