E - The type of value that can be comparedpublic interface BoundedValue<E> extends BaseValue<E>
Comparable or can be
compared using the Comparator such that the value is "bounded" by a
getMinValue() and a getMaxValue(). For a majority of
values, a BoundedValue is limited to being within it's destined
bounds. Any BoundedValue that is out of it's intended bounds will
throw an IllegalStateException if used or offered to a
ValueContainer or DataHolder.| Modifier and Type | Method and Description |
|---|---|
Comparator<E> |
getComparator()
The comparator used to compare a value of the proper type.
|
E |
getMaxValue()
Gets the required "maximum" value such that the value is only valid if
the following is true:
|
E |
getMinValue()
Gets the required "minimum" value such that the value is only valid if
the following is true:
|
E getMinValue()
if (getComparator().compare(getValue(), getMinValue()) >= 0)
.E getMaxValue()
if (getComparator().compare(getValue(), getMaxValue()) <= 0)
.Comparator<E> getComparator()
getMinValue() and
getMaxValue().