Package com.terracottatech.store
Interface Selection.ComparableSelection<T extends Comparable<T>>
- Type Parameters:
T
- Type
- All Superinterfaces:
Collection<T>
,Iterable<T>
,Selection<T>
- All Known Subinterfaces:
Selection.DoubleSelection
,Selection.IntSelection
,Selection.LongSelection
,Selection.NumberSelection<T>
Selection of Comparable elements. This adds min/max and range methods.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.terracottatech.store.Selection
Selection.ComparableSelection<T extends Comparable<T>>, Selection.DoubleSelection, Selection.IntSelection, Selection.LongSelection, Selection.NumberSelection<T extends Number & Comparable<T>>
-
Method Summary
Modifier and TypeMethodDescriptiongreaterThan
(T low) Return a newSelection.ComparableSelection
with values strictly greater than the parametergreaterThanOrEqual
(T low) Return a newSelection.ComparableSelection
with values greater than or equal to the parameterReturn a newSelection.ComparableSelection
with values strictly less than the parameterlessThanOrEqual
(T high) Return a newSelection.ComparableSelection
with values less than or equal to the parametermax()
Return an optional of the maximum value in this Selectionmin()
Return an optional of the minimum value in this SelectionMethods inherited from interface java.util.Collection
addAll, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, size, spliterator, stream, toArray, toArray, toArray
Methods inherited from interface com.terracottatech.store.Selection
add, clear, first, firstOrElse, firstOrFail, get, getOrElse, getOrFail, last, lastOrElse, lastOrFail, remove, removeAll, removeIf, retainAll, sole, soleOrElse
-
Method Details
-
greaterThan
Return a newSelection.ComparableSelection
with values strictly greater than the parameter- Parameters:
low
- low parameter.- Returns:
- filtered Selection
-
greaterThanOrEqual
Return a newSelection.ComparableSelection
with values greater than or equal to the parameter- Parameters:
low
- low parameter.- Returns:
- filtered Selection
-
lessThan
Return a newSelection.ComparableSelection
with values strictly less than the parameter- Parameters:
high
- high parameter.- Returns:
- filtered Selection
-
lessThanOrEqual
Return a newSelection.ComparableSelection
with values less than or equal to the parameter- Parameters:
high
- high parameter.- Returns:
- filtered Selection
-
min
Return an optional of the minimum value in this Selection- Returns:
- Optional with minimum value or empty() if Selection is empty.
-
max
Return an optional of the maximum value in this Selection- Returns:
- Optional with maximum value or empty() if Selection is empty.
-