Skip to content

Commit 1adb66c

Browse files
committed
Fixing Javadocs
1 parent 6abbd2a commit 1adb66c

File tree

6 files changed

+29
-25
lines changed

6 files changed

+29
-25
lines changed

src/main/java/com/jnape/palatable/lambda/functions/builtin/fn3/CmpEqWith.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
import static com.jnape.palatable.lambda.functions.specialized.Predicate.predicate;
1212

1313
/**
14-
* Given a {@link Comparator} from some type <code>A</code> and two values of type <code>A</code>, return <code>true</code>
15-
* if the first value is strictly equal to the second value (according to {@link Comparator#compare(A, A)}
16-
* otherwise, return false.
14+
* Given a {@link Comparator} from some type <code>A</code> and two values of type <code>A</code>, return
15+
* <code>true</code> if the first value is strictly equal to the second value (according to
16+
* {@link Comparator#compare(Object, Object)} otherwise, return false.
1717
*
1818
* @param <A> the value type
1919
* @see CmpEqBy
@@ -38,6 +38,11 @@ public Predicate<A> apply(Comparator<A> compareFn, A x) {
3838
return predicate(Fn3.super.apply(compareFn, x));
3939
}
4040

41+
@Override
42+
public Boolean checkedApply(Comparator<A> comparator, A a, A a2) {
43+
return compare(comparator, a, a2).equals(equal());
44+
}
45+
4146
@SuppressWarnings("unchecked")
4247
public static <A> CmpEqWith<A> cmpEqWith() {
4348
return (CmpEqWith<A>) INSTANCE;
@@ -54,9 +59,4 @@ public static <A> Predicate<A> cmpEqWith(Comparator<A> comparator, A x) {
5459
public static <A> Boolean cmpEqWith(Comparator<A> comparator, A x, A y) {
5560
return cmpEqWith(comparator, x).apply(y);
5661
}
57-
58-
@Override
59-
public Boolean checkedApply(Comparator<A> comparator, A a, A a2) {
60-
return compare(comparator, a, a2).equals(equal());
61-
}
6262
}

src/main/java/com/jnape/palatable/lambda/functions/builtin/fn3/Compare.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
/**
1111
* Given a {@link Comparator} from some type <code>A</code> and two values of type <code>A</code>, return a
12-
* {@link ComparisonRelation} of the first value with reference to the second value (according to {@link Comparator#compare(A, A)}.
13-
* The order of parameters is flipped with respect to {@link Comparator#compare(A, A)} for more idiomatic partial application.
14-
*
12+
* {@link ComparisonRelation} of the first value with reference to the second value (according to
13+
* {@link Comparator#compare(Object, Object)}. The order of parameters is flipped with respect to
14+
* {@link Comparator#compare(Object, Object)} for more idiomatic partial application.
1515
* <p>
1616
* Example:
1717
* <pre>
@@ -21,7 +21,6 @@
2121
* Compare.compare(naturalOrder(), 1, 1); // ComparisonRelation.Equal
2222
* }
2323
* </pre>
24-
* </p>
2524
*
2625
* @param <A> the value type
2726
* @see Comparator
@@ -30,7 +29,8 @@
3029
public final class Compare<A> implements Fn3<Comparator<A>, A, A, ComparisonRelation> {
3130
private static final Compare<?> INSTANCE = new Compare<>();
3231

33-
private Compare() { }
32+
private Compare() {
33+
}
3434

3535
@Override
3636
public ComparisonRelation checkedApply(Comparator<A> aComparator, A a, A a2) throws Throwable {

src/main/java/com/jnape/palatable/lambda/functions/builtin/fn3/GTEWith.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Given a {@link Comparator} from some type <code>A</code> and two values of type <code>A</code>,
1515
* return <code>true</code> if the second value is greater than or equal to the first value in
16-
* terms of their mapped <code>B</code> results according to {@link Comparator#compare(A, A)};
16+
* terms of their mapped <code>B</code> results according to {@link Comparator#compare(Object, Object)};
1717
* otherwise, return false.
1818
*
1919
* @param <A> the value type
@@ -38,6 +38,11 @@ public Predicate<A> apply(Comparator<A> compareFn, A x) {
3838
return predicate(Fn3.super.apply(compareFn, x));
3939
}
4040

41+
@Override
42+
public Boolean checkedApply(Comparator<A> comparator, A a, A a2) {
43+
return !ltWith(comparator, a, a2);
44+
}
45+
4146
@SuppressWarnings("unchecked")
4247
public static <A> GTEWith<A> gteWith() {
4348
return (GTEWith<A>) INSTANCE;
@@ -54,9 +59,4 @@ public static <A> Predicate<A> gteWith(Comparator<A> comparator, A y) {
5459
public static <A> Boolean gteWith(Comparator<A> comparator, A y, A x) {
5560
return gteWith(comparator, y).apply(x);
5661
}
57-
58-
@Override
59-
public Boolean checkedApply(Comparator<A> comparator, A a, A a2) {
60-
return !ltWith(comparator, a, a2);
61-
}
6262
}

src/main/java/com/jnape/palatable/lambda/functions/builtin/fn3/LTEWith.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Given a {@link Comparator} from some type <code>A</code> and two values of type <code>A</code>,
1515
* return <code>true</code> if the second value is less than or equal to the first value in
16-
* terms of their mapped <code>B</code> results according to {@link Comparator#compare(A, A)};
16+
* terms of their mapped <code>B</code> results according to {@link Comparator#compare(Object, Object)};
1717
* otherwise, return false.
1818
*
1919
* @param <A> the value type
@@ -38,6 +38,11 @@ public Predicate<A> apply(Comparator<A> compareFn, A x) {
3838
return predicate(Fn3.super.apply(compareFn, x));
3939
}
4040

41+
@Override
42+
public Boolean checkedApply(Comparator<A> comparator, A a, A a2) {
43+
return !gtWith(comparator, a, a2);
44+
}
45+
4146
@SuppressWarnings("unchecked")
4247
public static <A> LTEWith<A> lteWith() {
4348
return (LTEWith<A>) INSTANCE;
@@ -54,9 +59,4 @@ public static <A> Predicate<A> lteWith(Comparator<A> comparator, A y) {
5459
public static <A> Boolean lteWith(Comparator<A> comparator, A y, A x) {
5560
return lteWith(comparator, y).apply(x);
5661
}
57-
58-
@Override
59-
public Boolean checkedApply(Comparator<A> comparator, A a, A a2) {
60-
return !gtWith(comparator, a, a2);
61-
}
6262
}

src/main/java/com/jnape/palatable/lambda/functor/builtin/Writer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public <B> Writer<W, A> discardR(Applicative<B, Writer<W, ?>> appB) {
136136
/**
137137
* Construct a {@link Writer} from an accumulation.
138138
*
139+
* @param w the accumulation
139140
* @param <W> the accumulation type
140141
* @return the {@link Writer}
141142
*/
@@ -146,6 +147,7 @@ public static <W> Writer<W, Unit> tell(W w) {
146147
/**
147148
* Construct a {@link Writer} from a value.
148149
*
150+
* @param a the output value
149151
* @param <W> the accumulation type
150152
* @param <A> the value type
151153
* @return the {@link Writer}
@@ -157,6 +159,7 @@ public static <W, A> Writer<W, A> listen(A a) {
157159
/**
158160
* Construct a {@link Writer} from an accumulation and a value.
159161
*
162+
* @param aw the output value and accumulation
160163
* @param <W> the accumulation type
161164
* @param <A> the value type
162165
* @return the {@link WriterT}

src/main/java/com/jnape/palatable/lambda/monad/transformer/builtin/IterateT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ public <B> IterateT<M, B> pure(B b) {
230230
* as such, calling this on an infinite {@link IterateT} will result in either heap exhaustion (e.g. in the case of
231231
* {@link List lists}) or non-termination (e.g. in the case of {@link Set sets}).
232232
*
233+
* @param cFn0 the {@link Collection} construction function
233234
* @param <C> the {@link Collection} type
234235
* @param <MAS> the witnessed target type
235236
* @return the {@link List} inside of the effect

0 commit comments

Comments
 (0)