public class IntegerMinMax
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
max
Minimum and maximum.
|
private int |
min
Minimum and maximum.
|
Constructor and Description |
---|
IntegerMinMax()
Constructor without starting values.
|
IntegerMinMax(int min,
int max)
Constructor with predefined minimum and maximum values.
|
Modifier and Type | Method and Description |
---|---|
int[] |
asIntArray()
Return minimum and maximum as array.
|
long |
getDiff()
Return the difference between minimum and maximum.
|
int |
getMax()
Get the current maximum.
|
int |
getMin()
Get the current minimum.
|
boolean |
isValid()
Test whether the result is defined.
|
static IntegerMinMax[] |
newArray(int size)
Generate a new array of initialized IntegerMinMax objects (with default
constructor)
|
void |
put(int val)
Process a single int value.
|
void |
put(int[] data)
Process a whole array of int values.
|
void |
put(IntegerMinMax val)
Process a MinMax pair.
|
void |
reset()
Reset statistics.
|
public IntegerMinMax()
Integer.MAX_VALUE
.
The maximum will be initialized to Integer.MIN_VALUE
.
So that the first data added will replace both.public IntegerMinMax(int min, int max)
min
- Minimum valuemax
- Maximum valuepublic void put(int val)
val
- New valuepublic void put(int[] data)
data
- Data to processpublic void put(IntegerMinMax val)
val
- New valuepublic int getMin()
public int getMax()
public long getDiff()
public boolean isValid()
public int[] asIntArray()
public static IntegerMinMax[] newArray(int size)
size
- Array sizepublic void reset()
Copyright © 2019 ELKI Development Team. License information.