|
AlgART Home | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.algart.arrays.SummingHistogram.CountOfValues
public static final class SummingHistogram.CountOfValues extends java.lang.Object
The helper class for static methods of SummingHistogram class,
calculating the integrals of
More precisely, this class is used by the static methods
SummingHistogram.integralBetweenValues(long[], double, double, CountOfValues),SummingHistogram.integralBetweenValues(int[], double, double, CountOfValues),SummingHistogram.preciseIntegralBetweenValues(long[], double, double, CountOfValues),SummingHistogram.preciseIntegralBetweenValues(int[], double, double, CountOfValues)and allows to return some additional information. All these methods have two arguments
minValue, maxValue and calculate the integral of comments to Histogram class,
in terms of the simple histogram model for first 2 methods or the precise
histogram model for the last 2 methods. The integral is calculated between
Histogram class). This integral is returned in the result of the methods.
But, while calculating the integral, these methods incidentally calculate the additional information, which is stored in the instance of this class, passed as the last argument, if it is not null. Namely, they calculate:
count(): the difference
isLeftBound() flag: it is true if
isRightBound() flag: it is true if
If minValue≥maxValue, these methods always return 0.0 and fill the last argument
(if it is not null) by the following values: count()=0isLeftBound()=falseisRightBound()=false
Note: in the special case N=0 (all bars b[k] are zero)
the values of isLeftBound() and isRightBound() flags are not specified.
The only way to create an instance of this class is the constructor without arguments,
that creates an uninitialized instance.
"Uninitialized" means that any attempt to read information by count(),
isLeftBound() or isRightBound() leads to IllegalStateException.
The only way to change the information stored in this instance is calling one of 4 static methods
of SummingHistogram class, listed above.
These methods change its state to initialized.
This class does not implement own equals and hashCode methods. So, this class does not provide a mechanism for comparing different instances of this class.
This class is not thread-safe, but is thread-compatible and can be synchronized manually, if multithread access is necessary.
| Constructor and Description |
|---|
SummingHistogram.CountOfValues()
Creates new uninitialized instance of this class. |
| Modifier and Type | Method and Description |
|---|---|
double |
count()
Returns the difference |
boolean |
isInitialized()
Returns true if and only this object is initialized. |
boolean |
isLeftBound()
Returns true if |
boolean |
isRightBound()
Returns true if |
java.lang.String |
toString()
Returns a brief string description of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SummingHistogram.CountOfValues()
uninitialized instance of this class.
You must call one of
SummingHistogram.integralBetweenValues(long[], double, double, CountOfValues),
SummingHistogram.integralBetweenValues(int[], double, double, CountOfValues),
SummingHistogram.preciseIntegralBetweenValues(long[], double, double, CountOfValues),
SummingHistogram.preciseIntegralBetweenValues(int[], double, double, CountOfValues)
methods for this instance before you will be able to use it.
| Method Detail |
|---|
public boolean isInitialized()
SummingHistogram.integralBetweenValues(long[], double, double, CountOfValues),
SummingHistogram.integralBetweenValues(int[], double, double, CountOfValues),
SummingHistogram.preciseIntegralBetweenValues(long[], double, double, CountOfValues),
SummingHistogram.preciseIntegralBetweenValues(int[], double, double, CountOfValues)
methods at least once
and that method was successfully finished.
If the object is not initialized, then all its methods, excepting
this one and methods of the basic Object class (toString, equals, etc.)
throw IllegalStateException.
public boolean isLeftBound()
comments to this class for more details.
If minValue>=maxValue, this method returns false.
java.lang.IllegalStateException - if this instance is not initialized yet.public boolean isRightBound()
comments to this class for more details.
If minValue>=maxValue, this method returns false.
java.lang.IllegalStateException - if this instance is not initialized yet.public double count()
comments to this class for more details.
In the precise histogram model, this value can be zero only if
If minValue>=maxValue, this method returns 0.0.
isLeftBound() || isRightBound()
java.lang.IllegalStateException - if this instance is not initialized yet.public java.lang.String toString()
The result of this method may depend on implementation.
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||