ch.lambdaj.function.aggregate.Max Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lambdaj Show documentation
Show all versions of lambdaj Show documentation
The pseudo-functional collection manipulation library
The newest version!
// Modified or written by Lambdascale SRL for inclusion with lambdaj.
// Copyright (c) 2009-2010 Mario Fusco.
// Licensed under the Apache License, Version 2.0 (the "License")
package ch.lambdaj.function.aggregate;
/**
* A chooser of the maximum value between two comparable
* @author Mario Fusco
*/
public class Max extends Chooser> {
/**
* Chooses the maximum value between two Comparable
* @param first The first item between which find the maximum
* @param second The second item between which find the maximum
* @return The biggest between the two items
*/
@SuppressWarnings("unchecked")
@Override
protected Comparable choose(Comparable first, Comparable second) {
return first.compareTo((T) second) > 0 ? first : second;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy