Java Code Examples for org.apache.commons.lang3.math.NumberUtils#min()

The following examples show how to use org.apache.commons.lang3.math.NumberUtils#min() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NumberAggregationHelper.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Nullable
public Double min() {
    if (items.isEmpty()) {
        return null;
    }

    return NumberUtils.min(ArrayUtils.toPrimitive(items.toArray(new Double[items.size()])));
}
 
Example 2
Source File: BaseAction.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
protected Integer getCount(View view, Integer count) {
	Integer viewCount = view.getCount();
	Integer wiCount = ((count == null) || (count < 1) || (count > View.MAX_COUNT)) ? View.MAX_COUNT : count;
	return NumberUtils.min(viewCount, wiCount);
}
 
Example 3
Source File: BaseAction.java    From o2oa with GNU Affero General Public License v3.0 4 votes vote down vote up
protected Integer getCount(View view, Integer count) {
	Integer viewCount = view.getCount();
	Integer wiCount = ((count == null) || (count < 1) || (count > View.MAX_COUNT)) ? View.MAX_COUNT : count;
	return NumberUtils.min(viewCount, wiCount);
}
 
Example 4
Source File: MinValueInArray.java    From levelup-java-examples with Apache License 2.0 4 votes vote down vote up
@Test
public void find_min_value_in_array_with_apache_commons () {
	int lowest = NumberUtils.min(numbers);
	assertEquals(1, lowest);
}