backported part of r1003346 from trunk to branch 2.X

Make immutable private fields final


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/branches/MATH_2_X@1003886 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2010-10-02 21:04:44 +00:00
parent 87f2ace0ce
commit 1d3822bf9c
7 changed files with 12 additions and 10 deletions

View File

@ -73,7 +73,7 @@ public class Vector3DFormat extends CompositeFormat {
private final String trimmedSeparator;
/** The format used for components. */
private NumberFormat format;
private final NumberFormat format;
/**
* Create an instance with default settings.

View File

@ -44,7 +44,7 @@ public class OpenMapRealVector extends AbstractRealVector implements SparseRealV
private final int virtualSize;
/** Tolerance for having a value considered zero. */
private double epsilon;
private final double epsilon;
/**
* Build a 0-length vector.

View File

@ -76,7 +76,7 @@ public class RealVectorFormat extends CompositeFormat {
private final String trimmedSeparator;
/** The format used for components. */
private NumberFormat format;
private final NumberFormat format;
/**
* Create an instance with default settings.

View File

@ -34,7 +34,7 @@ public enum Relationship {
GEQ(">=");
/** Display string for the relationship. */
private String stringValue;
private final String stringValue;
/** Simple constructor.
* @param stringValue display string for the relationship

View File

@ -66,7 +66,7 @@ public class EmpiricalDistributionImpl implements Serializable, EmpiricalDistrib
private static final long serialVersionUID = 5729073523949762654L;
/** List of SummaryStatistics objects characterizing the bins */
private List<SummaryStatistics> binStats = null;
private final List<SummaryStatistics> binStats;
/** Sample statistics */
private SummaryStatistics sampleStats = null;
@ -81,7 +81,7 @@ public class EmpiricalDistributionImpl implements Serializable, EmpiricalDistrib
private double delta = 0d;
/** number of bins */
private int binCount = 1000;
private final int binCount;
/** is the distribution loaded? */
private boolean loaded = false;
@ -90,12 +90,13 @@ public class EmpiricalDistributionImpl implements Serializable, EmpiricalDistrib
private double[] upperBounds = null;
/** RandomData instance to use in repeated calls to getNext() */
private RandomData randomData = new RandomDataImpl();
private final RandomData randomData = new RandomDataImpl();
/**
* Creates a new EmpiricalDistribution with the default bin count.
*/
public EmpiricalDistributionImpl() {
binCount = 1000;
binStats = new ArrayList<SummaryStatistics>();
}

View File

@ -31,13 +31,13 @@ public class RandomAdaptor extends Random implements RandomGenerator {
private static final long serialVersionUID = 2306581345647615033L;
/** Wrapped randomGenerator instance */
private RandomGenerator randomGenerator = null;
private final RandomGenerator randomGenerator;
/**
* Prevent instantiation without a generator argument
*/
@SuppressWarnings("unused")
private RandomAdaptor() { }
private RandomAdaptor() { randomGenerator = null; }
/**
* Construct a RandomAdaptor wrapping the supplied RandomGenerator.

View File

@ -85,12 +85,13 @@ public class ValueServer {
private BufferedReader filePointer = null;
/** RandomDataImpl to use for random data generation. */
private RandomData randomData = new RandomDataImpl();
private final RandomData randomData;
// Data generation modes ======================================
/** Creates new ValueServer */
public ValueServer() {
randomData = new RandomDataImpl();
}
/**