V - is the generic type of the contained values.public class Range<V extends Comparable> extends Object implements Serializable, AttributeReadMinimumValue<V>, AttributeReadMaximumValue<V>
minimum and maximum. Validation is
performed at construction so a given Range should always be valid
(unless created via reflection or de-serialization). minimum and maximum value may be
null for unbounded ranges. It is still recommended to use fixed bounds such as Long.MAX_VALUE.
However, for types such as BigDecimal this is not possible.| Modifier and Type | Field and Description |
|---|---|
private V |
max |
static String |
MAX_UNBOUND
The unbound maximum.
|
private V |
min |
static String |
MIN_UNBOUND
The unbound minimum.
|
private static long |
serialVersionUID
UID for serialization.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Range()
The constructor for serialization.
|
|
Range(V min,
V max)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
V |
getMax()
Shorthand form for
getMaximumValue(). |
V |
getMaximumValue()
This method gets the maximum
value of this object. |
V |
getMin()
Shorthand form for
getMinimumValue(). |
V |
getMinimumValue()
This method gets the minimum
value of this object. |
boolean |
isContained(V value)
|
String |
toString() |
void |
verifyContained(V value)
This method verifies that the given
value is contained in this range. |
private static final long serialVersionUID
private V extends Comparable min
getMin()private V extends Comparable max
getMax()public static final String MIN_UNBOUND
public static final String MAX_UNBOUND
public V getMin()
getMinimumValue().null and NOT be less than max.public V getMax()
getMaximumValue().null and NOT be greater than min.public V getMinimumValue()
value of this object. A legal value has
to be greater or equal to this minimum.getMinimumValue in interface AttributeReadMinimumValue<V extends Comparable>value or
null if unbounded.getMin()public V getMaximumValue()
value of this object. A legal value has
to be less or equal to this maximum.getMaximumValue in interface AttributeReadMaximumValue<V extends Comparable>value or
null if unbounded.getMax()public boolean isContained(V value)
public void verifyContained(V value) throws ValueOutOfRangeException
value is contained in this range.value - is the value to check.ValueOutOfRangeException - if not contained.Copyright © 2001–2015 mmm-Team. All rights reserved.