PickerColumn

public class PickerColumn


Picker column class used by 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 or a list of static labels set by setStaticLabels.

Summary

Public constructors

Public methods

int

Get total items count between minValue and maxValue.

int

Returns current value of the Column.

CharSequence
getLabelFor(int value)

Get a label for value.

String

Return string format (see format) to display label for value.

int

Returns maximum value of the Column.

int

Returns minimal value of the Column.

CharSequence[]

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 format) 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 constructors

PickerColumn

Added in 1.1.0
public PickerColumn()

Public methods

getCount

Added in 1.1.0
public int getCount()

Get total items count between minValue and maxValue.

Returns
int

Total items count between minValue and maxValue.

getCurrentValue

Added in 1.1.0
public int getCurrentValue()

Returns current value of the Column.

Returns
int

Current value of the Column.

getLabelFor

Added in 1.1.0
public CharSequence getLabelFor(int value)

Get a label for value. The label can be static setStaticLabels or dynamically generated setLabelFormat when static labels is null.

Parameters
int value

Value between minValue and maxValue.

Returns
CharSequence

Label for the value.

getLabelFormat

Added in 1.1.0
public String getLabelFormat()

Return string format (see format) to display label for value.

Returns
String

String format to display label for value.

getMaxValue

Added in 1.1.0
public int getMaxValue()

Returns maximum value of the Column.

Returns
int

Maximum value of the Column.

getMinValue

Added in 1.1.0
public int getMinValue()

Returns minimal value of the Column.

Returns
int

Minimal value of the Column.

getStaticLabels

Added in 1.1.0
public CharSequence[] getStaticLabels()

Returns static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels.length - 1]. When null, getLabelFormat will be used.

setCurrentValue

Added in 1.1.0
public void setCurrentValue(int value)

Sets current value of the Column.

setLabelFormat

Added in 1.1.0
public void setLabelFormat(String labelFormat)

Set string format (see format) to display label for an integer value. setStaticLabels overrides the format.

Parameters
String labelFormat

String format to display label for value between minValue and maxValue.

setMaxValue

Added in 1.1.0
public void setMaxValue(int maxValue)

Sets maximum value of the Column.

Parameters
int maxValue

New maximum value to set.

setMinValue

Added in 1.1.0
public void setMinValue(int minValue)

Sets minimal value of the Column.

Parameters
int minValue

New minimal value to set.

setStaticLabels

Added in 1.1.0
public void setStaticLabels(CharSequence[] labels)

Set static labels for each value, minValue maps to labels[0], maxValue maps to labels[labels.length - 1].

Parameters
CharSequence[] labels

Static labels for each value between minValue and maxValue.