Fix checkstyle issues
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/functor/trunk@1541690 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/core/src/main/java/org/apache/commons/functor/generator/loop/IteratorToGeneratorAdapter.java b/core/src/main/java/org/apache/commons/functor/generator/loop/IteratorToGeneratorAdapter.java
index b98f0f1..6b4ef21 100644
--- a/core/src/main/java/org/apache/commons/functor/generator/loop/IteratorToGeneratorAdapter.java
+++ b/core/src/main/java/org/apache/commons/functor/generator/loop/IteratorToGeneratorAdapter.java
@@ -27,44 +27,73 @@
* @version $Revision: 1508677 $ $Date: 2013-07-30 19:48:02 -0300 (Tue, 30 Jul 2013) $
*/
public final class IteratorToGeneratorAdapter<E> extends LoopGenerator<E> {
+ /**
+ * Helper iterator.
+ * @param <E> the type of elements in this iterator.
+ */
private static class EqualityIterator<E> implements Iterator<E> {
+ /**
+ * Iterable that owns this iterator.
+ */
final Iterable<? extends E> owner;
+ /**
+ * Wrapped iterator.
+ */
final Iterator<? extends E> wrapped;
-
+ /**
+ * Create a new EqualityIterator.
+ * @param owner iterable that owns this iterator
+ */
EqualityIterator(Iterable<? extends E> owner) {
super();
this.owner = Validate.notNull(owner);
this.wrapped = owner.iterator();
}
+ /**
+ * {@inheritDoc}
+ */
public boolean hasNext() {
return wrapped.hasNext();
}
+ /**
+ * {@inheritDoc}
+ */
public E next() {
return wrapped.next();
}
+ /**
+ * {@inheritDoc}
+ */
public void remove() {
wrapped.remove();
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
- if (obj instanceof EqualityIterator<?> == false) {
+ if (!(obj instanceof EqualityIterator)) {
return false;
}
return ((EqualityIterator<?>) obj).owner.equals(owner);
}
-
+
+ /**
+ * {@inheritDoc}
+ */
@Override
public int hashCode() {
- int result = 71 << 4;
- result |= owner.hashCode();
- return result;
+ int hash = "IteratorToGeneratorAdapater$EqualityIterator".hashCode();
+ hash <<= 2;
+ hash ^= owner.hashCode();
+ return hash;
}
}
diff --git a/core/src/main/java/org/apache/commons/functor/range/AbstractRange.java b/core/src/main/java/org/apache/commons/functor/range/AbstractRange.java
index 185a447..c120573 100644
--- a/core/src/main/java/org/apache/commons/functor/range/AbstractRange.java
+++ b/core/src/main/java/org/apache/commons/functor/range/AbstractRange.java
@@ -48,6 +48,9 @@
*/
protected final S step;
+ /**
+ * Function to implement the taking of a step.
+ */
private final BinaryFunction<T, S, T> nextValue;
/**
@@ -58,7 +61,8 @@
* @param step increment step
* @param nextValue function to implement the taking of a step
*/
- protected AbstractRange(Endpoint<T> leftEndpoint, Endpoint<T> rightEndpoint, S step, BinaryFunction<T, S, T> nextValue) {
+ protected AbstractRange(Endpoint<T> leftEndpoint, Endpoint<T> rightEndpoint, S step,
+ BinaryFunction<T, S, T> nextValue) {
super();
this.leftEndpoint = Validate.notNull(leftEndpoint, "Left Endpoint argument must not be null");
this.rightEndpoint = Validate.notNull(rightEndpoint, "Right Endpoint argument must not be null");
@@ -121,7 +125,7 @@
/**
* Create a non-empty iterator.
- *
+ *
* @return Iterator
*/
protected abstract Iterator<T> createIterator();
diff --git a/core/src/main/java/org/apache/commons/functor/range/IntegerRange.java b/core/src/main/java/org/apache/commons/functor/range/IntegerRange.java
index 036b746..9f43d32 100644
--- a/core/src/main/java/org/apache/commons/functor/range/IntegerRange.java
+++ b/core/src/main/java/org/apache/commons/functor/range/IntegerRange.java
@@ -23,7 +23,7 @@
/**
* A range of integers.
- *
+ *
* @since 1.0
* @version $Revision: 1385335 $ $Date: 2012-09-16 15:08:31 -0300 (Sun, 16 Sep 2012) $
*/
@@ -47,7 +47,7 @@
// ---------------------------------------------------------------
/**
* Create a new IntegerRange.
- *
+ *
* @param from
* start
* @param to
@@ -59,7 +59,7 @@
/**
* Create a new IntegerRange.
- *
+ *
* @param from
* start
* @param to
@@ -73,7 +73,7 @@
/**
* Create a new IntegerRange.
- *
+ *
* @param from
* start
* @param to
@@ -85,7 +85,7 @@
/**
* Create a new IntegerRange.
- *
+ *
* @param from
* start
* @param to
@@ -99,7 +99,7 @@
/**
* Create a new IntegerRange.
- *
+ *
* @param from
* start
* @param to
@@ -113,7 +113,7 @@
/**
* Create a new IntegerRange.
- *
+ *
* @param from
* start
* @param leftBoundType
@@ -128,10 +128,10 @@
public IntegerRange(int from, BoundType leftBoundType, int to, BoundType rightBoundType) {
this(from, leftBoundType, to, rightBoundType, DEFAULT_STEP.evaluate(from, to));
}
-
+
/**
* Create a new IntegerRange.
- *
+ *
* @param from
* start
* @param to
@@ -158,7 +158,7 @@
/**
* Create a new IntegerRange.
- *
+ *
* @param from
* start
* @param leftBoundType
diff --git a/core/src/main/java/org/apache/commons/functor/range/NumericRange.java b/core/src/main/java/org/apache/commons/functor/range/NumericRange.java
index f743231..78ba927 100644
--- a/core/src/main/java/org/apache/commons/functor/range/NumericRange.java
+++ b/core/src/main/java/org/apache/commons/functor/range/NumericRange.java
@@ -34,13 +34,14 @@
public abstract class NumericRange<T extends Number & Comparable<T>> extends AbstractRange<T, T> {
/**
- * Construct a new {@link NumericRange}.T
+ * Construct a new {@link NumericRange}.
* @param leftEndpoint left endpoint
* @param rightEndpoint right endpoint
* @param step increment step
* @param nextValue function to implement the taking of a step
*/
- protected NumericRange(Endpoint<T> leftEndpoint, Endpoint<T> rightEndpoint, T step, BinaryFunction<T, T, T> nextValue) {
+ protected NumericRange(Endpoint<T> leftEndpoint, Endpoint<T> rightEndpoint, T step,
+ BinaryFunction<T, T, T> nextValue) {
super(leftEndpoint, rightEndpoint, step, nextValue);
}