public static class DateTimePattern.Element extends Object
Calendar object. It provides a
minimal and maximal value for the integer value, which can be requested by code which is
producing a user interface to enter dates.| Modifier and Type | Field and Description |
|---|---|
(package private) int |
field |
| Constructor and Description |
|---|
Element(String n,
int field,
int min,
int max) |
Element(String n,
int field,
int min,
int max,
int offset) |
| Modifier and Type | Method and Description |
|---|---|
int |
getField()
The associated constant in
Calendar, e.g. |
int |
getMax()
The maximal value this field of the Calendar object can take.
|
int |
getMin()
The minimal value this field of the Calendar object can take.
|
String |
getName()
The name of the field in a Calendar object.
|
int |
getNullValue()
The int-value representing
null. |
int |
getOffset()
An offset to be used for presentation.
|
int |
getValue(Calendar cal)
Normally equivalent with
cal.getValue(getField()) |
String |
toString() |
String |
toString(int value,
Locale locale,
int length)
Converts a value for the Calendar field associated with this Element to a
String.
|
Element(String n, int field, int min, int max)
Element(String n, int field, int min, int max, int offset)
public final String getName()
public final int getField()
public final int getMin()
public final int getMax()
public final int getOffset()
public int getValue(Calendar cal)
cal.getValue(getField())public String toString(int value, Locale locale, int length)
value - the value to convertlocale - A locale can be used in some instances. E.g. to generate month names.length - An indication of verboseness. Typically numeric results if a small number
(perhaps filled to this length) or words if a big number (and it makes sense, e.g. for
months, and weekdays).public int getNullValue()
null. Some otherwise impossible value for the
field. This can be use as a marker value in the option-list to set the calendar value to null.MMBase 1.9-SNAPSHOT - ${javadoctimestamp}