public class PickerColumn extends Object
Picker
, defines a contiguous value ranges and associated
labels. A PickerColumn has a minValue and maxValue to choose between. The Picker column has
a current value.
The labels can be dynamically generated from value by setLabelFormat(String)
or
a list of static labels set by setStaticLabels(CharSequence[])
.Constructor and Description |
---|
PickerColumn() |
Modifier and Type | Method and Description |
---|---|
int |
getCount()
Get total items count between minValue and maxValue.
|
int |
getCurrentValue()
Returns current value of the Column.
|
CharSequence |
getLabelFor(int value)
Get a label for value.
|
String |
getLabelFormat()
Return string format (see
String.format(java.lang.String, java.lang.Object...) ) to display label for
value. |
int |
getMaxValue()
Returns maximum value of the Column.
|
int |
getMinValue()
Returns minimal value of the Column.
|
CharSequence[] |
getStaticLabels()
Returns static labels for each value, minValue maps to labels[0], maxValue maps to
labels[labels.length - 1].
|
void |
setCurrentValue(int value)
Sets current value of the Column.
|
void |
setLabelFormat(String labelFormat)
Set string format (see
String.format(java.lang.String, java.lang.Object...) ) to display label for an
integer value. |
void |
setMaxValue(int maxValue)
Sets maximum value of the Column.
|
void |
setMinValue(int minValue)
Sets minimal value of the Column.
|
void |
setStaticLabels(CharSequence[] labels)
Set static labels for each value, minValue maps to labels[0], maxValue maps to
labels[labels.length - 1].
|
public void setLabelFormat(String labelFormat)
String.format(java.lang.String, java.lang.Object...)
) to display label for an
integer value. setStaticLabels(CharSequence[])
overrides the format.labelFormat
- String format to display label for value between minValue and maxValue.public String getLabelFormat()
String.format(java.lang.String, java.lang.Object...)
) to display label for
value.public void setStaticLabels(CharSequence[] labels)
labels
- Static labels for each value between minValue and maxValue.public CharSequence[] getStaticLabels()
getLabelFormat()
will be used.public CharSequence getLabelFor(int value)
setStaticLabels(CharSequence[])
or dynamically generated (@link setLabelFormat(String)
when static labels is null.value
- Value between minValue and maxValue.public int getCurrentValue()
public void setCurrentValue(int value)
public int getCount()
public int getMinValue()
public int getMaxValue()
public void setMinValue(int minValue)
minValue
- New minimal value to set.public void setMaxValue(int maxValue)
maxValue
- New maximum value to set.