|
AlgART Home | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.algart.arrays.Arrays.MinMaxInfo
public static final class Arrays.MinMaxInfo extends java.lang.Object
The helper class for Arrays.rangeOf(PArray, MinMaxInfo) method, containing information
about the minimum and maximum in some AlgART array.
The instance of this class contains the following information:
index of minimal and index of maximal
elements in the AlgART array;range() min..max}: the values of minimal and maximal elements;initialized boolean flag, which is false after
creating the instance by the constructor
(when this object does not contain useful information) and
which is set to true before filling this object by real information at the end of executing
Arrays.rangeOf(PArray, MinMaxInfo) method;The only way to create an instance of this class is the constructor without arguments,
that creates an uninitialized instance.
The only way to change the information stored in this instance is calling
Arrays.rangeOf(PArray, MinMaxInfo) method, that fills the instance by the actual information
and changes its state to initialized.
This class is thread-safe: you may use the same instance of this class in several threads. The state of the instance is always consistent: all information, stored in it, including initialized flag, is always changed simultaneously in a synchronized block.
| Constructor and Description |
|---|
Arrays.MinMaxInfo()
Creates new uninitialized instance of this class. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other instance of this class is equal to this instance. |
int |
hashCode()
Returns the hash code of this range. |
long |
indexOfMax()
Returns the index of the maximal array element stored in this object. |
long |
indexOfMin()
Returns the index of the minimal array element stored in this object. |
boolean |
isInitialized()
Returns true if and only this object is initialized, that is if it was passed to Arrays.rangeOf(PArray, MinMaxInfo) method at least once
and this method was successfully finished. |
double |
max()
Returns the value of the maximal array element stored in this object. |
double |
min()
Returns the value of the minimal array element stored in this object. |
Range |
range()
Returns the values of both minimal and maximal array element stored in this object. |
java.lang.String |
toString()
Returns a brief string description of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Arrays.MinMaxInfo()
uninitialized instance of this class.
You must call Arrays.rangeOf(PArray, MinMaxInfo) method for this instance
before you will be able to use it.
| Method Detail |
|---|
public boolean isInitialized()
Arrays.rangeOf(PArray, MinMaxInfo) method at least once
and this 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 long indexOfMin()
java.lang.IllegalStateException - if this instance is not initialized yet.public long indexOfMax()
java.lang.IllegalStateException - if this instance is not initialized yet.public double min()
java.lang.IllegalStateException - if this instance is not initialized yet.public double max()
java.lang.IllegalStateException - if this instance is not initialized yet.public Range range()
java.lang.IllegalStateException - if this instance is not initialized yet.public java.lang.String toString()
The result of this method may depend on implementation and usually contains the indexes and values of the found minimum and maximum.
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
MinMaxInfo
and the information, stored in both instances, is fully identical.
equals in class java.lang.Objectobj - the object to be compared for equality with this instance.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||