Formatting.
Closes #142.
diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImpl.java b/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImpl.java
index 132c4a3..3dfeda1 100644
--- a/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImpl.java
+++ b/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImpl.java
@@ -30,21 +30,18 @@
/**
*/
public class ListUnivariateImpl extends DescriptiveStatistics implements Serializable {
-
/** Serializable version identifier */
private static final long serialVersionUID = -8837442489133392138L;
-
/**
* Holds a reference to a list - GENERICs are going to make
* our lives easier here as we could only accept List<Number>
*/
protected List<Object> list;
-
/** Number Transformer maps Objects to Number for us. */
protected NumberTransformer transformer;
/**
- * No argument Constructor
+ * No argument constructor
*/
public ListUnivariateImpl(){
this(new ArrayList<>());
@@ -64,7 +61,6 @@
* @param transformer the number transformer used to convert the list items.
*/
public ListUnivariateImpl(List<Object> list, NumberTransformer transformer) {
- super();
this.list = list;
this.transformer = transformer;
}
@@ -72,7 +68,6 @@
/** {@inheritDoc} */
@Override
public double[] getValues() {
-
int length = list.size();
// If the window size is not INFINITE_WINDOW AND
@@ -97,9 +92,7 @@
/** {@inheritDoc} */
@Override
public double getElement(int index) {
-
double value = Double.NaN;
-
int calcIndex = index;
final int wSize = getWindowSize();
@@ -132,6 +125,7 @@
} else {
n = list.size();
}
+
return n;
}
@@ -166,11 +160,12 @@
*/
@Override
public double apply(UnivariateStatistic stat) {
- double[] v = this.getValues();
+ final double[] v = this.getValues();
if (v != null) {
return stat.evaluate(v, 0, v.length);
}
+
return Double.NaN;
}
@@ -194,12 +189,11 @@
@Override
public void setWindowSize(int windowSize) {
super.setWindowSize(windowSize);
- //Discard elements from the front of the list if the windowSize is less than
- // the size of the list.
- int extra = list.size() - windowSize;
+ // Discard elements from the front of the list if "windowSize"
+ // is less than the size of the list.
+ final int extra = list.size() - windowSize;
if (extra > 0) {
list.subList(0, extra).clear();
}
}
-
}