Author: simonetripodi
Date: Fri Sep 23 20:43:02 2011
New Revision: 1175010
URL: http://svn.apache.org/viewvc?rev=1175010&view=rev
Log:
added missing javadoc comments
Modified:
commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/FoldRight.java
Modified: commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/FoldRight.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/FoldRight.java?rev=1175010&r1=1175009&r2=1175010&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/FoldRight.java
(original)
+++ commons/proper/functor/trunk/src/main/java/org/apache/commons/functor/core/algorithm/FoldRight.java
Fri Sep 23 20:43:02 2011
@@ -29,6 +29,8 @@ import org.apache.commons.functor.genera
* Uses the seed object (if supplied) as the initial right-side argument to the {@link BinaryFunction},
* then uses the result of that evaluation as the next right-side argument, until the {@link
Generator}'s
* elements have been expended.
+ *
+ * @param <T> the returned evaluation type.
* @version $Revision$ $Date$
*/
public class FoldRight<T> implements UnaryFunction<Generator<T>, T>, BinaryFunction<Generator<T>,
T, T>, Serializable {
@@ -40,15 +42,31 @@ public class FoldRight<T> implements Una
/**
* Helper class
+ *
+ * @param <T> the returned evaluation type.
*/
private static class FoldRightHelper<T> implements UnaryProcedure<T> {
+ /**
+ * The stack where storing the wrapped function evaluations.
+ */
private final Stack<T> stk = new Stack<T>();
+ /**
+ * The wrapped function.
+ */
private final BinaryFunction<? super T, ? super T, ? extends T> function;
+ /**
+ * The seed object.
+ */
private final T seed;
+ /**
+ * Flag to check the helper started or not.
+ */
private final boolean hasSeed;
/**
* Create a seedless FoldRightHelper.
+ *
+ * @param function The wrapped function
*/
public FoldRightHelper(BinaryFunction<? super T, ? super T, ? extends T> function)
{
this(null, function);
@@ -56,7 +74,9 @@ public class FoldRight<T> implements Una
/**
* Create a new FoldRightHelper.
+ *
* @param seed initial right-side argument
+ * @param function The wrapped function
*/
FoldRightHelper(T seed, BinaryFunction<? super T, ? super T, ? extends T> function)
{
this.seed = seed;
@@ -92,6 +112,9 @@ public class FoldRight<T> implements Una
}
+ /**
+ * {@link BinaryFunction} to apply to each (seed, next).
+ */
private final BinaryFunction<? super T, ? super T, ? extends T> function;
/**
|