vigna / fastutil

fastutil extends the Java™ Collections Framework by providing type-specific maps, sets, lists and queues.
Apache License 2.0
1.78k stars 196 forks source link

Make BooleanPredicate extend BooleanUnaryOperator #209

Closed techsy730 closed 3 years ago

techsy730 commented 3 years ago

Make BooleanPredicate extend BooleanUnaryOperator, as it is a unary operation.

Also add a identity to UnaryOperators (and a negation for BooleanUnaryOperator).

techsy730 commented 3 years ago

Ignore the commits involving DirectBooleanSet; this is just a side effect of the merge from another branch. They are deleted in 812c480.

techsy730 commented 3 years ago

Actually, I can do this cleaner

vigna commented 3 years ago

Ok. We totally need a protocol. I just finished writing a UnaryOperator.drv to avoid ambiguity in List.replaceAll(). 🤷🏻‍♂️

techsy730 commented 3 years ago

Yes, and I am using that UnaryOperator in a later commit

vigna commented 3 years ago

LOL ok sorry I thought we stepped onto each other's toes. 😅

techsy730 commented 3 years ago

See https://github.com/vigna/fastutil/pull/210 for a cleaner PR