static class SpinnerValueFactory.LocalDateSpinnerValueFactory extends SpinnerValueFactory<java.time.LocalDate>
SpinnerValueFactory
implementation designed to iterate through
LocalDate
values.
Note that the default converter
is implemented
simply as shown below, which may be adequate in many cases, but it is important
for users to ensure that this suits their needs (and adjust when necessary):
setConverter(new StringConverter<LocalDate>() { @Override public String toString(LocalDate object) { if (object == null) { return ""; } return object.toString(); } @Override public LocalDate fromString(String string) { return LocalDate.parse(string); } });
Type | Property and Description |
---|---|
LongProperty |
amountToStepBy
Sets the amount to increment or decrement by, per step.
|
<any> |
max
Sets the maximum allowable value for this value factory
|
<any> |
min
Sets the minimum allowable value for this value factory
|
<any> |
temporalUnit
The size of each step (e.g.
|
converterProperty, valueProperty, wrapAroundProperty
SpinnerValueFactory.DoubleSpinnerValueFactory, SpinnerValueFactory.IntegerSpinnerValueFactory, SpinnerValueFactory.ListSpinnerValueFactory<T>, SpinnerValueFactory.LocalDateSpinnerValueFactory, SpinnerValueFactory.LocalTimeSpinnerValueFactory
Modifier and Type | Field and Description |
---|---|
private LongProperty |
amountToStepBy |
private <any> |
max |
private <any> |
min
*
Properties *
*
|
private <any> |
temporalUnit |
Constructor and Description |
---|
LocalDateSpinnerValueFactory()
Creates a new instance of the LocalDateSpinnerValueFactory, using the
value returned by calling
LocalDate#now() as the initial value,
and using a stepping amount of one day. |
LocalDateSpinnerValueFactory(java.time.LocalDate initialValue)
Creates a new instance of the LocalDateSpinnerValueFactory, using the
provided initial value, and a stepping amount of one day.
|
LocalDateSpinnerValueFactory(java.time.LocalDate min,
java.time.LocalDate max,
java.time.LocalDate initialValue)
Creates a new instance of the LocalDateSpinnerValueFactory, using the
provided initial value, and a stepping amount of one day.
|
LocalDateSpinnerValueFactory(java.time.LocalDate min,
java.time.LocalDate max,
java.time.LocalDate initialValue,
long amountToStepBy,
java.time.temporal.TemporalUnit temporalUnit)
Creates a new instance of the LocalDateSpinnerValueFactory, using the
provided min, max, and initial values, as well as the amount to step
by and
TemporalUnit . |
Modifier and Type | Method and Description |
---|---|
LongProperty |
amountToStepByProperty()
Sets the amount to increment or decrement by, per step.
|
void |
decrement(int steps)
Attempts to decrement the
value by the given
number of steps. |
long |
getAmountToStepBy()
Gets the value of the property amountToStepBy.
|
java.time.LocalDate |
getMax()
Gets the value of the property max.
|
java.time.LocalDate |
getMin()
Gets the value of the property min.
|
java.time.temporal.TemporalUnit |
getTemporalUnit()
Gets the value of the property temporalUnit.
|
void |
increment(int steps)
Attempts to omcrement the
value by the given
number of steps. |
<any> |
maxProperty()
Sets the maximum allowable value for this value factory
|
<any> |
minProperty()
Sets the minimum allowable value for this value factory
|
void |
setAmountToStepBy(long value)
Sets the value of the property amountToStepBy.
|
void |
setMax(java.time.LocalDate value)
Sets the value of the property max.
|
void |
setMin(java.time.LocalDate value)
Sets the value of the property min.
|
void |
setTemporalUnit(java.time.temporal.TemporalUnit value)
Sets the value of the property temporalUnit.
|
<any> |
temporalUnitProperty()
The size of each step (e.g.
|
converterProperty, getConverter, getValue, isWrapAround, setConverter, setValue, setWrapAround, valueProperty, wrapAroundProperty
public final <any> minProperty
public final <any> maxProperty
getMax()
,
setMax(LocalDate)
public final <any> temporalUnitProperty
getTemporalUnit()
,
setTemporalUnit(TemporalUnit)
public final LongProperty amountToStepByProperty
getAmountToStepBy()
,
setAmountToStepBy(long)
private <any> min
private <any> max
private <any> temporalUnit
private LongProperty amountToStepBy
public LocalDateSpinnerValueFactory()
LocalDate#now()
as the initial value,
and using a stepping amount of one day.public LocalDateSpinnerValueFactory(java.time.LocalDate initialValue)
initialValue
- The value of the Spinner when first instantiated.public LocalDateSpinnerValueFactory(java.time.LocalDate min, java.time.LocalDate max, java.time.LocalDate initialValue)
min
- The minimum allowed double value for the Spinner.max
- The maximum allowed double value for the Spinner.initialValue
- The value of the Spinner when first instantiated.public LocalDateSpinnerValueFactory(java.time.LocalDate min, java.time.LocalDate max, java.time.LocalDate initialValue, long amountToStepBy, java.time.temporal.TemporalUnit temporalUnit)
TemporalUnit
.
To better understand, here are a few examples:
new LocalDateSpinnerValueFactory(LocalDate.MIN, LocalDate.MAX, LocalDate.now(), 1, ChronoUnit.DAYS)
new LocalDateSpinnerValueFactory(LocalDate.MIN, LocalDate.MAX, LocalDate.now(), 1, ChronoUnit.MONTHS)
new LocalDateSpinnerValueFactory(LocalDate.MIN, LocalDate.MAX, LocalDate.now(), 1, ChronoUnit.YEARS)
min
- The minimum allowed double value for the Spinner.max
- The maximum allowed double value for the Spinner.initialValue
- The value of the Spinner when first instantiated.amountToStepBy
- The amount to increment or decrement by, per step.temporalUnit
- The size of each step (e.g. day, week, month, year, etc)public final void setMin(java.time.LocalDate value)
public final java.time.LocalDate getMin()
public final <any> minProperty()
public final void setMax(java.time.LocalDate value)
public final java.time.LocalDate getMax()
public final <any> maxProperty()
getMax()
,
setMax(LocalDate)
public final void setTemporalUnit(java.time.temporal.TemporalUnit value)
public final java.time.temporal.TemporalUnit getTemporalUnit()
public final <any> temporalUnitProperty()
getTemporalUnit()
,
setTemporalUnit(TemporalUnit)
public final void setAmountToStepBy(long value)
public final long getAmountToStepBy()
public final LongProperty amountToStepByProperty()
getAmountToStepBy()
,
setAmountToStepBy(long)
public void decrement(int steps)
value
by the given
number of steps.decrement
in class SpinnerValueFactory<java.time.LocalDate>
steps
- The number of decrements that should be performed on the value.public void increment(int steps)
value
by the given
number of steps.increment
in class SpinnerValueFactory<java.time.LocalDate>
steps
- The number of increments that should be performed on the value.