Skip to main content

Numbers

isOdd#

import j8plus.ArrayFuns;
Numbers.isOdd(0); // falseNumbers.isOdd(1); // trueNumbers.isOdd(2); // falseNumbers.isOdd(3); // true

ODD_INTEGER#

import java.util.stream.*;import static java.util.stream.Collectors.toList;
import j8plus.ArrayFuns;
final List<Integer> list = Arrays.asList(0, 1, 2, 3, 4, 5)  .stream()  .filter(ArrayFuns.ODD_INTEGER)  .collect(toList());// [1, 3, 5]

isEven#

import j8plus.ArrayFuns;
Numbers.isEven(0); // trueNumbers.isEven(1); // falseNumbers.isEven(2); // trueNumbers.isEven(3); // false

EVEN_INTEGER#

import java.util.stream.*;import static java.util.stream.Collectors.toList;
import j8plus.ArrayFuns;
final List<Integer> list = Arrays.asList(0, 1, 2, 3, 4, 5)  .stream()  .filter(ArrayFuns.EVEN_INTEGER)  .collect(toList());// [0, 2, 4]