V - generic type of element valuespublic abstract class AdvancedElement<V extends Comparable<V>> extends BasicElement<V>
Default implementation of a chronological element with some element-related manipulation methods.
| Modifier | Constructor and Description |
|---|---|
protected |
AdvancedElement(String name)
Used by subclasses which usually assign an instance to a
static constant (creating a singleton).
|
| Modifier and Type | Method and Description |
|---|---|
<T extends ChronoEntity<T>> |
atCeiling(Class<T> context)
Yields an operator which rounds any entity up so that the child
elements will be set to the maximum.
|
<T extends ChronoEntity<T>> |
atFloor(Class<T> context)
Yields an operator which rounds any entity down so that the child
elements will be set to the minimum.
|
int |
compare(ChronoDisplay o1,
ChronoDisplay o2)
Compares the values of this element based on their natural order.
|
<T extends ChronoEntity<T>> |
decremented(Class<T> context)
Yields a new operator which can set any entity such that its
actual element value gets the decremented value.
|
<T extends ChronoEntity<T>> |
incremented(Class<T> context)
Yields a new operator which can set any entity such that its
actual element value gets the incremented value.
|
<T extends ChronoEntity<T>> |
maximized(Class<T> context)
Yields a new operator which can set any entity to its maximum
element value.
|
<T extends ChronoEntity<T>> |
minimized(Class<T> context)
Yields a new operator which can set any entity to its minimum
element value.
|
<T extends ChronoEntity<T>> |
newValue(V value,
Class<T> context)
Yields an operator which sets any entity such that its actual
element value will be set in normal mode to given value.
|
<T extends ChronoEntity<T>> |
setLenient(V value,
Class<T> context)
Yields an operator which sets any entity such that its actual
element value will be set in lenient mode to given value.
|
derive, equals, getParent, getSymbol, getVeto, hashCode, isLenient, isLocal, name, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDefaultMaximum, getDefaultMinimum, getType, isDateElement, isTimeElementprotected AdvancedElement(String name)
Used by subclasses which usually assign an instance to a static constant (creating a singleton).
name - name of elementIllegalArgumentException - if the name is empty or if it only
contains white space (spaces, tabs etc.)ChronoElement.name()public int compare(ChronoDisplay o1, ChronoDisplay o2)
Compares the values of this element based on their natural order.
o1 - the first object to be comparedo2 - the second object to be comparedChronoException - if this element is not registered in any entity
and/or if no element rule exists to extract the element valuepublic <T extends ChronoEntity<T>> ChronoOperator<T> minimized(Class<T> context)
Yields a new operator which can set any entity to its minimum element value.
T - generic type of target entitycontext - context typepublic <T extends ChronoEntity<T>> ChronoOperator<T> maximized(Class<T> context)
Yields a new operator which can set any entity to its maximum element value.
T - generic type of target entitycontext - context typepublic <T extends ChronoEntity<T>> ChronoOperator<T> decremented(Class<T> context)
Yields a new operator which can set any entity such that its actual element value gets the decremented value.
T - generic type of target entitycontext - context typeTimeAxis.getBaseUnit(ChronoElement)public <T extends ChronoEntity<T>> ChronoOperator<T> incremented(Class<T> context)
Yields a new operator which can set any entity such that its actual element value gets the incremented value.
T - generic type of target entitycontext - context typeTimeAxis.getBaseUnit(ChronoElement)public <T extends ChronoEntity<T>> ChronoOperator<T> atFloor(Class<T> context)
Yields an operator which rounds any entity down so that the child elements will be set to the minimum.
T - generic type of target entitycontext - context typepublic <T extends ChronoEntity<T>> ChronoOperator<T> atCeiling(Class<T> context)
Yields an operator which rounds any entity up so that the child elements will be set to the maximum.
T - generic type of target entitycontext - context typepublic <T extends ChronoEntity<T>> ChronoOperator<T> setLenient(V value, Class<T> context)
Yields an operator which sets any entity such that its actual element value will be set in lenient mode to given value.
T - generic type of target entityvalue - new element valuecontext - context typepublic <T extends ChronoEntity<T>> ChronoOperator<T> newValue(V value, Class<T> context)
Yields an operator which sets any entity such that its actual element value will be set in normal mode to given value.
T - generic type of target entityvalue - new element valuecontext - context typeCopyright © 2014–2015. All rights reserved.