Package org.threeten.bp.temporal
Enum IsoFields.Field
- java.lang.Object
-
- java.lang.Enum<IsoFields.Field>
-
- org.threeten.bp.temporal.IsoFields.Field
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<IsoFields.Field>,TemporalField
- Enclosing class:
- IsoFields
private static enum IsoFields.Field extends java.lang.Enum<IsoFields.Field> implements TemporalField
Implementation of the field.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DAY_OF_QUARTERQUARTER_OF_YEARWEEK_BASED_YEARWEEK_OF_WEEK_BASED_YEAR
-
Field Summary
Fields Modifier and Type Field Description private static int[]QUARTER_DAYS
-
Constructor Summary
Constructors Modifier Constructor Description privateField()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDisplayName(java.util.Locale locale)Gets the display name for the field in the requested locale.private static intgetWeek(LocalDate date)private static intgetWeekBasedYear(LocalDate date)private static intgetWeekRange(int wby)private static ValueRangegetWeekRange(LocalDate date)booleanisDateBased()Checks if this field is date-based.private static booleanisIso(TemporalAccessor temporal)booleanisTimeBased()Checks if this field is time-based.TemporalAccessorresolve(java.util.Map<TemporalField,java.lang.Long> fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle)Resolves the date/time information in the builderstatic IsoFields.FieldvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static IsoFields.Field[]values()Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface org.threeten.bp.temporal.TemporalField
adjustInto, getBaseUnit, getFrom, getRangeUnit, isSupportedBy, range, rangeRefinedBy
-
-
-
-
Enum Constant Detail
-
DAY_OF_QUARTER
public static final IsoFields.Field DAY_OF_QUARTER
-
QUARTER_OF_YEAR
public static final IsoFields.Field QUARTER_OF_YEAR
-
WEEK_OF_WEEK_BASED_YEAR
public static final IsoFields.Field WEEK_OF_WEEK_BASED_YEAR
-
WEEK_BASED_YEAR
public static final IsoFields.Field WEEK_BASED_YEAR
-
-
Method Detail
-
values
public static IsoFields.Field[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (IsoFields.Field c : IsoFields.Field.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static IsoFields.Field valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getDisplayName
public java.lang.String getDisplayName(java.util.Locale locale)
Description copied from interface:TemporalFieldGets the display name for the field in the requested locale.If there is no display name for the locale then a suitable default must be returned.
The default implementation must check the locale is not null and return
toString().- Specified by:
getDisplayNamein interfaceTemporalField- Parameters:
locale- the locale to use, not null- Returns:
- the display name for the locale or a suitable default, not null
-
resolve
public TemporalAccessor resolve(java.util.Map<TemporalField,java.lang.Long> fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle)
Description copied from interface:TemporalFieldResolves the date/time information in the builderThis method is invoked during the resolve of the builder. Implementations should combine the associated field with others to form objects like
LocalDate,LocalTimeandLocalDateTime- Specified by:
resolvein interfaceTemporalField- Parameters:
fieldValues- the map of fields to values, which can be updated, not nullpartialTemporal- the partially complete temporal to query for zone and chronology; querying for other things is undefined and not recommended, not nullresolverStyle- the requested type of resolve, not null- Returns:
- the resolved temporal object; null if resolving only changed the map, or no resolve occurred
-
isDateBased
public boolean isDateBased()
Description copied from interface:TemporalFieldChecks if this field is date-based.A date-based field can be derived from epoch-day
- Specified by:
isDateBasedin interfaceTemporalField- Returns:
- true if date-based
-
isTimeBased
public boolean isTimeBased()
Description copied from interface:TemporalFieldChecks if this field is time-based.A time-based field can be derived from nano-of-day
- Specified by:
isTimeBasedin interfaceTemporalField- Returns:
- true if time-based
-
isIso
private static boolean isIso(TemporalAccessor temporal)
-
getWeekRange
private static ValueRange getWeekRange(LocalDate date)
-
getWeekRange
private static int getWeekRange(int wby)
-
getWeek
private static int getWeek(LocalDate date)
-
getWeekBasedYear
private static int getWeekBasedYear(LocalDate date)
-
-