100 |
|
|
101 |
|
/** |
102 |
|
* Returns a reducer returning maximum of two values, or |
103 |
< |
* <tt>null</tt> if both arguments are null, and that casts |
103 |
> |
* {@code null} if both arguments are null, and that casts |
104 |
|
* its arguments as Comparable on each comparison, throwing |
105 |
|
* ClassCastException on failure. |
106 |
|
*/ |
118 |
|
|
119 |
|
/** |
120 |
|
* Returns a reducer returning minimum of two values, or |
121 |
< |
* <tt>null</tt> if both arguments are null, and that casts |
121 |
> |
* {@code null} if both arguments are null, and that casts |
122 |
|
* its arguments as Comparable on each comparison, throwing |
123 |
|
* ClassCastException on failure. |
124 |
|
*/ |
521 |
|
*/ |
522 |
|
public static <T> DoubleOp compoundOp |
523 |
|
(final DoubleToObject<? extends T> first, |
524 |
< |
final ObjectToDouble<? super T> second) { |
524 |
> |
final ObjectToDouble<? super T> second) { |
525 |
|
return new DoubleOp() { |
526 |
|
public final double op(double t) { return second.op(first.op(t)); } |
527 |
|
}; |
533 |
|
*/ |
534 |
|
public static <T> LongToDouble compoundOp |
535 |
|
(final LongToObject<? extends T> first, |
536 |
< |
final ObjectToDouble<? super T> second) { |
536 |
> |
final ObjectToDouble<? super T> second) { |
537 |
|
return new LongToDouble() { |
538 |
|
public final double op(long t) { return second.op(first.op(t)); } |
539 |
|
}; |
545 |
|
*/ |
546 |
|
public static <T> DoubleToLong compoundOp |
547 |
|
(final DoubleToObject<? extends T> first, |
548 |
< |
final ObjectToLong<? super T> second) { |
548 |
> |
final ObjectToLong<? super T> second) { |
549 |
|
return new DoubleToLong() { |
550 |
|
public final long op(double t) { return second.op(first.op(t)); } |
551 |
|
}; |
557 |
|
*/ |
558 |
|
public static <T> LongOp compoundOp |
559 |
|
(final LongToObject<? extends T> first, |
560 |
< |
final ObjectToLong<? super T> second) { |
560 |
> |
final ObjectToLong<? super T> second) { |
561 |
|
return new LongOp() { |
562 |
|
public final long op(long t) { return second.op(first.op(t)); } |
563 |
|
}; |
711 |
|
/** |
712 |
|
* Returns a predicate evaluating to true if its argument is non-null |
713 |
|
*/ |
714 |
< |
public static Predicate<Object> isNonNullPredicate() { |
714 |
> |
public static Predicate<Object> isNonNullPredicate() { |
715 |
|
return IsNonNullPredicate.predicate; |
716 |
|
} |
717 |
|
static final class IsNonNullPredicate implements Predicate<Object> { |
725 |
|
/** |
726 |
|
* Returns a predicate evaluating to true if its argument is null |
727 |
|
*/ |
728 |
< |
public static Predicate<Object> isNullPredicate() { |
728 |
> |
public static Predicate<Object> isNullPredicate() { |
729 |
|
return IsNullPredicate.predicate; |
730 |
|
} |
731 |
|
static final class IsNullPredicate implements Predicate<Object> { |
952 |
|
|
953 |
|
/** |
954 |
|
* Returns a predicate evaluating to true if the |
955 |
< |
* first argument <tt>equals</tt> the second |
955 |
> |
* first argument {@code equals} the second |
956 |
|
*/ |
957 |
|
public static BinaryPredicate<Object, Object> equalityPredicate() { |
958 |
|
return EqualityPredicate.predicate; |
967 |
|
|
968 |
|
/** |
969 |
|
* Returns a predicate evaluating to true if the |
970 |
< |
* first argument <tt>==</tt> the second |
970 |
> |
* first argument {@code ==} the second |
971 |
|
*/ |
972 |
|
public static BinaryPredicate<Object, Object> identityPredicate() { |
973 |
|
return IdentityPredicate.predicate; |
982 |
|
|
983 |
|
/** |
984 |
|
* Returns a predicate evaluating to true if the |
985 |
< |
* first argument <tt>==</tt> the second |
985 |
> |
* first argument {@code ==} the second |
986 |
|
*/ |
987 |
|
public static BinaryIntPredicate intEqualityPredicate() { |
988 |
|
return IntEqualityPredicate.predicate; |
997 |
|
|
998 |
|
/** |
999 |
|
* Returns a predicate evaluating to true if the |
1000 |
< |
* first argument <tt>==</tt> the second |
1000 |
> |
* first argument {@code ==} the second |
1001 |
|
*/ |
1002 |
|
public static BinaryLongPredicate longEqualityPredicate() { |
1003 |
|
return LongEqualityPredicate.predicate; |
1012 |
|
|
1013 |
|
/** |
1014 |
|
* Returns a predicate evaluating to true if the |
1015 |
< |
* first argument <tt>==</tt> the second |
1015 |
> |
* first argument {@code ==} the second |
1016 |
|
*/ |
1017 |
|
public static BinaryDoublePredicate doubleEqualityPredicate() { |
1018 |
|
return DoubleEqualityPredicate.predicate; |
1028 |
|
|
1029 |
|
/** |
1030 |
|
* Returns a predicate evaluating to true if the |
1031 |
< |
* first argument <tt>!equals</tt> the second |
1031 |
> |
* first argument {@code !equals} the second |
1032 |
|
*/ |
1033 |
|
public static BinaryPredicate<Object, Object> inequalityPredicate() { |
1034 |
|
return InequalityPredicate.predicate; |
1043 |
|
|
1044 |
|
/** |
1045 |
|
* Returns a predicate evaluating to true if the |
1046 |
< |
* first argument <tt>!=</tt> the second |
1046 |
> |
* first argument {@code !=} the second |
1047 |
|
*/ |
1048 |
|
public static BinaryPredicate<Object, Object> nonidentityPredicate() { |
1049 |
|
return NonidentityPredicate.predicate; |
1058 |
|
|
1059 |
|
/** |
1060 |
|
* Returns a predicate evaluating to true if the |
1061 |
< |
* first argument <tt>!=</tt> the second |
1061 |
> |
* first argument {@code !=} the second |
1062 |
|
*/ |
1063 |
|
public static BinaryIntPredicate intInequalityPredicate() { |
1064 |
|
return IntInequalityPredicate.predicate; |
1073 |
|
|
1074 |
|
/** |
1075 |
|
* Returns a predicate evaluating to true if the |
1076 |
< |
* first argument <tt>==</tt> the second |
1076 |
> |
* first argument {@code ==} the second |
1077 |
|
*/ |
1078 |
|
public static BinaryLongPredicate longInequalityPredicate() { |
1079 |
|
return LongInequalityPredicate.predicate; |
1088 |
|
|
1089 |
|
/** |
1090 |
|
* Returns a predicate evaluating to true if the |
1091 |
< |
* first argument <tt>!=</tt> the second |
1091 |
> |
* first argument {@code !=} the second |
1092 |
|
*/ |
1093 |
|
public static BinaryDoublePredicate doubleInequalityPredicate() { |
1094 |
|
return DoubleInequalityPredicate.predicate; |