Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Collectable.bitAnd(), bitOr() including mapping overloads #212

Closed
lukaseder opened this issue Mar 13, 2016 · 0 comments
Closed

Add Collectable.bitAnd(), bitOr() including mapping overloads #212

lukaseder opened this issue Mar 13, 2016 · 0 comments

Comments

@lukaseder
Copy link
Member

New methods are:

Optional<T> bitAnd();
<U> Optional<U> bitAnd(Function<? super T, ? extends U> function);
int bitAndInt(ToIntFunction<? super T> function);
long bitAndLong(ToLongFunction<? super T> function);

Optional<T> bitOr();
<U> Optional<U> bitOr(Function<? super T, ? extends U> function);
int bitOrInt(ToIntFunction<? super T> function);
long bitOrLong(ToLongFunction<? super T> function);

Reference type overloads need to return Optional<?>, because the type of the identity value (e.g. Byte, Short, Integer, Long) is not known. Unlike for primitive types, where the identity value for AND is Integer.MAX_VALUE or Long.MAX_VALUE, whereas the identity value for OR is 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant