mirror of
https://github.com/apache/commons-math.git
synced 2025-02-08 11:05:56 +00:00
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:
parent
87f2ace0ce
commit
1d3822bf9c
@ -73,7 +73,7 @@ public class Vector3DFormat extends CompositeFormat {
|
|||||||
private final String trimmedSeparator;
|
private final String trimmedSeparator;
|
||||||
|
|
||||||
/** The format used for components. */
|
/** The format used for components. */
|
||||||
private NumberFormat format;
|
private final NumberFormat format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an instance with default settings.
|
* Create an instance with default settings.
|
||||||
|
@ -44,7 +44,7 @@ public class OpenMapRealVector extends AbstractRealVector implements SparseRealV
|
|||||||
private final int virtualSize;
|
private final int virtualSize;
|
||||||
|
|
||||||
/** Tolerance for having a value considered zero. */
|
/** Tolerance for having a value considered zero. */
|
||||||
private double epsilon;
|
private final double epsilon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build a 0-length vector.
|
* Build a 0-length vector.
|
||||||
|
@ -76,7 +76,7 @@ public class RealVectorFormat extends CompositeFormat {
|
|||||||
private final String trimmedSeparator;
|
private final String trimmedSeparator;
|
||||||
|
|
||||||
/** The format used for components. */
|
/** The format used for components. */
|
||||||
private NumberFormat format;
|
private final NumberFormat format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an instance with default settings.
|
* Create an instance with default settings.
|
||||||
|
@ -34,7 +34,7 @@ public enum Relationship {
|
|||||||
GEQ(">=");
|
GEQ(">=");
|
||||||
|
|
||||||
/** Display string for the relationship. */
|
/** Display string for the relationship. */
|
||||||
private String stringValue;
|
private final String stringValue;
|
||||||
|
|
||||||
/** Simple constructor.
|
/** Simple constructor.
|
||||||
* @param stringValue display string for the relationship
|
* @param stringValue display string for the relationship
|
||||||
|
@ -66,7 +66,7 @@ public class EmpiricalDistributionImpl implements Serializable, EmpiricalDistrib
|
|||||||
private static final long serialVersionUID = 5729073523949762654L;
|
private static final long serialVersionUID = 5729073523949762654L;
|
||||||
|
|
||||||
/** List of SummaryStatistics objects characterizing the bins */
|
/** List of SummaryStatistics objects characterizing the bins */
|
||||||
private List<SummaryStatistics> binStats = null;
|
private final List<SummaryStatistics> binStats;
|
||||||
|
|
||||||
/** Sample statistics */
|
/** Sample statistics */
|
||||||
private SummaryStatistics sampleStats = null;
|
private SummaryStatistics sampleStats = null;
|
||||||
@ -81,7 +81,7 @@ public class EmpiricalDistributionImpl implements Serializable, EmpiricalDistrib
|
|||||||
private double delta = 0d;
|
private double delta = 0d;
|
||||||
|
|
||||||
/** number of bins */
|
/** number of bins */
|
||||||
private int binCount = 1000;
|
private final int binCount;
|
||||||
|
|
||||||
/** is the distribution loaded? */
|
/** is the distribution loaded? */
|
||||||
private boolean loaded = false;
|
private boolean loaded = false;
|
||||||
@ -90,12 +90,13 @@ public class EmpiricalDistributionImpl implements Serializable, EmpiricalDistrib
|
|||||||
private double[] upperBounds = null;
|
private double[] upperBounds = null;
|
||||||
|
|
||||||
/** RandomData instance to use in repeated calls to getNext() */
|
/** 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.
|
* Creates a new EmpiricalDistribution with the default bin count.
|
||||||
*/
|
*/
|
||||||
public EmpiricalDistributionImpl() {
|
public EmpiricalDistributionImpl() {
|
||||||
|
binCount = 1000;
|
||||||
binStats = new ArrayList<SummaryStatistics>();
|
binStats = new ArrayList<SummaryStatistics>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,13 +31,13 @@ public class RandomAdaptor extends Random implements RandomGenerator {
|
|||||||
private static final long serialVersionUID = 2306581345647615033L;
|
private static final long serialVersionUID = 2306581345647615033L;
|
||||||
|
|
||||||
/** Wrapped randomGenerator instance */
|
/** Wrapped randomGenerator instance */
|
||||||
private RandomGenerator randomGenerator = null;
|
private final RandomGenerator randomGenerator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prevent instantiation without a generator argument
|
* Prevent instantiation without a generator argument
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private RandomAdaptor() { }
|
private RandomAdaptor() { randomGenerator = null; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a RandomAdaptor wrapping the supplied RandomGenerator.
|
* Construct a RandomAdaptor wrapping the supplied RandomGenerator.
|
||||||
|
@ -85,12 +85,13 @@ public class ValueServer {
|
|||||||
private BufferedReader filePointer = null;
|
private BufferedReader filePointer = null;
|
||||||
|
|
||||||
/** RandomDataImpl to use for random data generation. */
|
/** RandomDataImpl to use for random data generation. */
|
||||||
private RandomData randomData = new RandomDataImpl();
|
private final RandomData randomData;
|
||||||
|
|
||||||
// Data generation modes ======================================
|
// Data generation modes ======================================
|
||||||
|
|
||||||
/** Creates new ValueServer */
|
/** Creates new ValueServer */
|
||||||
public ValueServer() {
|
public ValueServer() {
|
||||||
|
randomData = new RandomDataImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user