Package org.joda.time.chrono
Class BasicWeekOfWeekyearDateTimeField
- java.lang.Object
-
- org.joda.time.DateTimeField
-
- org.joda.time.field.BaseDateTimeField
-
- org.joda.time.field.PreciseDurationDateTimeField
-
- org.joda.time.chrono.BasicWeekOfWeekyearDateTimeField
-
final class BasicWeekOfWeekyearDateTimeField extends PreciseDurationDateTimeField
Provides time calculations for the week of a week based year component of time.- Since:
- 1.1, refactored from GJWeekOfWeekyearDateTimeField
-
-
Field Summary
Fields Modifier and Type Field Description private BasicChronologyiChronologyprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description BasicWeekOfWeekyearDateTimeField(BasicChronology chronology, DurationField weeks)Restricted constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intget(long instant)Get the week of a week based year component of the specified time instant.intgetMaximumValue()Get the maximum allowable value for this field.intgetMaximumValue(long instant)Get the maximum value for this field evaluated at the specified time.intgetMaximumValue(ReadablePartial partial)Get the maximum value for this field evaluated at the specified instant.intgetMaximumValue(ReadablePartial partial, int[] values)Get the maximum value for this field using the partial instant and the specified values.protected intgetMaximumValueForSet(long instant, int value)Called by the set method to get the maximum allowed value.intgetMinimumValue()Get the minimum value for the field.DurationFieldgetRangeDurationField()Returns the range duration of this field.private java.lang.ObjectreadResolve()Serialization singletonlongremainder(long instant)This method assumes that this field is properly rounded on 1970-01-01T00:00:00.longroundCeiling(long instant)This method assumes that this field is properly rounded on 1970-01-01T00:00:00.longroundFloor(long instant)This method assumes that this field is properly rounded on 1970-01-01T00:00:00.-
Methods inherited from class org.joda.time.field.PreciseDurationDateTimeField
getDurationField, getUnitMillis, isLenient, set
-
Methods inherited from class org.joda.time.field.BaseDateTimeField
add, add, add, addWrapField, addWrapField, addWrapPartial, convertText, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsText, getAsText, getAsText, getAsText, getAsText, getDifference, getDifferenceAsLong, getLeapAmount, getLeapDurationField, getMaximumShortTextLength, getMaximumTextLength, getMinimumValue, getMinimumValue, getMinimumValue, getName, getType, isLeap, isSupported, roundHalfCeiling, roundHalfEven, roundHalfFloor, set, set, set, set, toString
-
Methods inherited from class org.joda.time.DateTimeField
setExtended
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
iChronology
private final BasicChronology iChronology
-
-
Constructor Detail
-
BasicWeekOfWeekyearDateTimeField
BasicWeekOfWeekyearDateTimeField(BasicChronology chronology, DurationField weeks)
Restricted constructor
-
-
Method Detail
-
get
public int get(long instant)
Get the week of a week based year component of the specified time instant.- Specified by:
getin classBaseDateTimeField- Parameters:
instant- the time instant in millis to query.- Returns:
- the week of the year extracted from the input.
- See Also:
DateTimeField.get(long)
-
getRangeDurationField
public DurationField getRangeDurationField()
Description copied from class:BaseDateTimeFieldReturns the range duration of this field. For example, if this field represents "hour of day", then the range duration is a day.- Specified by:
getRangeDurationFieldin classBaseDateTimeField- Returns:
- the range duration of this field, or null if field has no range
-
roundFloor
public long roundFloor(long instant)
Description copied from class:PreciseDurationDateTimeFieldThis method assumes that this field is properly rounded on 1970-01-01T00:00:00. If the rounding alignment differs, override this method as follows:return super.roundFloor(instant + ALIGNMENT_MILLIS) - ALIGNMENT_MILLIS;
- Overrides:
roundFloorin classPreciseDurationDateTimeField- Parameters:
instant- the milliseconds from 1970-01-01T00:00:00Z to round- Returns:
- rounded milliseconds
-
roundCeiling
public long roundCeiling(long instant)
Description copied from class:PreciseDurationDateTimeFieldThis method assumes that this field is properly rounded on 1970-01-01T00:00:00. If the rounding alignment differs, override this method as follows:return super.roundCeiling(instant + ALIGNMENT_MILLIS) - ALIGNMENT_MILLIS;
- Overrides:
roundCeilingin classPreciseDurationDateTimeField- Parameters:
instant- the milliseconds from 1970-01-01T00:00:00Z to round- Returns:
- rounded milliseconds
-
remainder
public long remainder(long instant)
Description copied from class:PreciseDurationDateTimeFieldThis method assumes that this field is properly rounded on 1970-01-01T00:00:00. If the rounding alignment differs, override this method as follows:return super.remainder(instant + ALIGNMENT_MILLIS);
- Overrides:
remainderin classPreciseDurationDateTimeField- Parameters:
instant- the milliseconds from 1970-01-01T00:00:00Z to get the remainder- Returns:
- remainder duration, in milliseconds
-
getMinimumValue
public int getMinimumValue()
Description copied from class:PreciseDurationDateTimeFieldGet the minimum value for the field.- Overrides:
getMinimumValuein classPreciseDurationDateTimeField- Returns:
- the minimum value
-
getMaximumValue
public int getMaximumValue()
Description copied from class:BaseDateTimeFieldGet the maximum allowable value for this field.- Specified by:
getMaximumValuein classBaseDateTimeField- Returns:
- the maximum valid value for this field, in the units of the field
-
getMaximumValue
public int getMaximumValue(long instant)
Description copied from class:BaseDateTimeFieldGet the maximum value for this field evaluated at the specified time.This implementation returns the same as
BaseDateTimeField.getMaximumValue().- Overrides:
getMaximumValuein classBaseDateTimeField- Parameters:
instant- the milliseconds from 1970-01-01T00:00:00Z to query- Returns:
- the maximum value for this field, in the units of the field
-
getMaximumValue
public int getMaximumValue(ReadablePartial partial)
Description copied from class:BaseDateTimeFieldGet the maximum value for this field evaluated at the specified instant.This implementation returns the same as
BaseDateTimeField.getMaximumValue().- Overrides:
getMaximumValuein classBaseDateTimeField- Parameters:
partial- the partial instant to query- Returns:
- the maximum value for this field, in the units of the field
-
getMaximumValue
public int getMaximumValue(ReadablePartial partial, int[] values)
Description copied from class:BaseDateTimeFieldGet the maximum value for this field using the partial instant and the specified values.This implementation returns the same as
BaseDateTimeField.getMaximumValue(ReadablePartial).- Overrides:
getMaximumValuein classBaseDateTimeField- Parameters:
partial- the partial instant to queryvalues- the values to use- Returns:
- the maximum value for this field, in the units of the field
-
getMaximumValueForSet
protected int getMaximumValueForSet(long instant, int value)Description copied from class:PreciseDurationDateTimeFieldCalled by the set method to get the maximum allowed value. By default, returns getMaximumValue(instant). Override to provide a faster implementation.- Overrides:
getMaximumValueForSetin classPreciseDurationDateTimeField
-
readResolve
private java.lang.Object readResolve()
Serialization singleton
-
-