org.joda.time.field

Class UnsupportedDateTimeField

Implemented Interfaces:
Serializable

public final class UnsupportedDateTimeField
extends DateTimeField
implements Serializable

A placeholder implementation to use when a datetime field is not supported.

UnsupportedDateTimeField is thread-safe and immutable.

Author:
Brian S O'Neill
Since:
1.0

Method Summary

long
add(long instant, int value)
Delegates to the duration field.
long
add(long instant, long value)
Delegates to the duration field.
int[]
add(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)
Always throws UnsupportedOperationException
long
addWrapField(long instant, int value)
Always throws UnsupportedOperationException
int[]
addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)
Always throws UnsupportedOperationException
int[]
addWrapPartial(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)
Always throws UnsupportedOperationException
int
get(long instant)
Always throws UnsupportedOperationException
String
getAsShortText(int fieldValue, Locale locale)
Always throws UnsupportedOperationException
String
getAsShortText(long instant)
Always throws UnsupportedOperationException
String
getAsShortText(long instant, Locale locale)
Always throws UnsupportedOperationException
String
getAsShortText(ReadablePartial partial, Locale locale)
Always throws UnsupportedOperationException
String
getAsShortText(ReadablePartial partial, int fieldValue, Locale locale)
Always throws UnsupportedOperationException
String
getAsText(int fieldValue, Locale locale)
Always throws UnsupportedOperationException
String
getAsText(long instant)
Always throws UnsupportedOperationException
String
getAsText(long instant, Locale locale)
Always throws UnsupportedOperationException
String
getAsText(ReadablePartial partial, Locale locale)
Always throws UnsupportedOperationException
String
getAsText(ReadablePartial partial, int fieldValue, Locale locale)
Always throws UnsupportedOperationException
int
getDifference(long minuendInstant, long subtrahendInstant)
Delegates to the duration field.
long
getDifferenceAsLong(long minuendInstant, long subtrahendInstant)
Delegates to the duration field.
DurationField
getDurationField()
Even though this DateTimeField is unsupported, the duration field might be supported.
static UnsupportedDateTimeField
getInstance(DateTimeFieldType type, DurationField durationField)
Gets an instance of UnsupportedDateTimeField for a specific named field.
int
getLeapAmount(long instant)
Always throws UnsupportedOperationException
DurationField
getLeapDurationField()
Always returns null.
int
getMaximumShortTextLength(Locale locale)
Always throws UnsupportedOperationException
int
getMaximumTextLength(Locale locale)
Always throws UnsupportedOperationException
int
getMaximumValue()
Always throws UnsupportedOperationException
int
getMaximumValue(long instant)
Always throws UnsupportedOperationException
int
getMaximumValue(ReadablePartial instant)
Always throws UnsupportedOperationException
int
getMaximumValue(ReadablePartial instant, int[] values)
Always throws UnsupportedOperationException
int
getMinimumValue()
Always throws UnsupportedOperationException
int
getMinimumValue(long instant)
Always throws UnsupportedOperationException
int
getMinimumValue(ReadablePartial instant)
Always throws UnsupportedOperationException
int
getMinimumValue(ReadablePartial instant, int[] values)
Always throws UnsupportedOperationException
String
getName()
Get the name of the field.
DurationField
getRangeDurationField()
Always returns null.
DateTimeFieldType
getType()
Get the type of the field.
boolean
isLeap(long instant)
Always throws UnsupportedOperationException
boolean
isLenient()
This field is not lenient.
boolean
isSupported()
This field is not supported.
long
remainder(long instant)
Always throws UnsupportedOperationException
long
roundCeiling(long instant)
Always throws UnsupportedOperationException
long
roundFloor(long instant)
Always throws UnsupportedOperationException
long
roundHalfCeiling(long instant)
Always throws UnsupportedOperationException
long
roundHalfEven(long instant)
Always throws UnsupportedOperationException
long
roundHalfFloor(long instant)
Always throws UnsupportedOperationException
long
set(long instant, String text)
Always throws UnsupportedOperationException
long
set(long instant, String text, Locale locale)
Always throws UnsupportedOperationException
long
set(long instant, int value)
Always throws UnsupportedOperationException
int[]
set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale)
Always throws UnsupportedOperationException
int[]
set(ReadablePartial instant, int fieldIndex, int[] values, int newValue)
Always throws UnsupportedOperationException
String
toString()
Get a suitable debug string.

Methods inherited from class org.joda.time.DateTimeField

add, add, add, addWrapField, addWrapField, addWrapPartial, get, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsShortText, getAsText, getAsText, getAsText, getAsText, getAsText, getDifference, getDifferenceAsLong, getDurationField, getLeapAmount, getLeapDurationField, getMaximumShortTextLength, getMaximumTextLength, getMaximumValue, getMaximumValue, getMaximumValue, getMaximumValue, getMinimumValue, getMinimumValue, getMinimumValue, getMinimumValue, getName, getRangeDurationField, getType, isLeap, isLenient, isSupported, remainder, roundCeiling, roundFloor, roundHalfCeiling, roundHalfEven, roundHalfFloor, set, set, set, set, set, toString

Method Details

add

public long add(long instant,
                int value)
Delegates to the duration field.
Overrides:
add in interface DateTimeField

add

public long add(long instant,
                long value)
Delegates to the duration field.
Overrides:
add in interface DateTimeField

add

public int[] add(ReadablePartial instant,
                 int fieldIndex,
                 int[] values,
                 int valueToAdd)
Always throws UnsupportedOperationException
Overrides:
add in interface DateTimeField

addWrapField

public long addWrapField(long instant,
                         int value)
Always throws UnsupportedOperationException
Overrides:
addWrapField in interface DateTimeField

addWrapField

public int[] addWrapField(ReadablePartial instant,
                          int fieldIndex,
                          int[] values,
                          int valueToAdd)
Always throws UnsupportedOperationException
Overrides:
addWrapField in interface DateTimeField

addWrapPartial

public int[] addWrapPartial(ReadablePartial instant,
                            int fieldIndex,
                            int[] values,
                            int valueToAdd)
Always throws UnsupportedOperationException
Overrides:
addWrapPartial in interface DateTimeField

get

public int get(long instant)
Always throws UnsupportedOperationException
Overrides:
get in interface DateTimeField

getAsShortText

public String getAsShortText(int fieldValue,
                             Locale locale)
Always throws UnsupportedOperationException
Overrides:
getAsShortText in interface DateTimeField

getAsShortText

public String getAsShortText(long instant)
Always throws UnsupportedOperationException
Overrides:
getAsShortText in interface DateTimeField

getAsShortText

public String getAsShortText(long instant,
                             Locale locale)
Always throws UnsupportedOperationException
Overrides:
getAsShortText in interface DateTimeField

getAsShortText

public String getAsShortText(ReadablePartial partial,
                             Locale locale)
Always throws UnsupportedOperationException
Overrides:
getAsShortText in interface DateTimeField

getAsShortText

public String getAsShortText(ReadablePartial partial,
                             int fieldValue,
                             Locale locale)
Always throws UnsupportedOperationException
Overrides:
getAsShortText in interface DateTimeField

getAsText

public String getAsText(int fieldValue,
                        Locale locale)
Always throws UnsupportedOperationException
Overrides:
getAsText in interface DateTimeField

getAsText

public String getAsText(long instant)
Always throws UnsupportedOperationException
Overrides:
getAsText in interface DateTimeField

getAsText

public String getAsText(long instant,
                        Locale locale)
Always throws UnsupportedOperationException
Overrides:
getAsText in interface DateTimeField

getAsText

public String getAsText(ReadablePartial partial,
                        Locale locale)
Always throws UnsupportedOperationException
Overrides:
getAsText in interface DateTimeField

getAsText

public String getAsText(ReadablePartial partial,
                        int fieldValue,
                        Locale locale)
Always throws UnsupportedOperationException
Overrides:
getAsText in interface DateTimeField

getDifference

public int getDifference(long minuendInstant,
                         long subtrahendInstant)
Delegates to the duration field.
Overrides:
getDifference in interface DateTimeField

getDifferenceAsLong

public long getDifferenceAsLong(long minuendInstant,
                                long subtrahendInstant)
Delegates to the duration field.
Overrides:
getDifferenceAsLong in interface DateTimeField

getDurationField

public DurationField getDurationField()
Even though this DateTimeField is unsupported, the duration field might be supported.
Overrides:
getDurationField in interface DateTimeField
Returns:
a possibly supported DurationField

getInstance

public static UnsupportedDateTimeField getInstance(DateTimeFieldType type,
                                                   DurationField durationField)
Gets an instance of UnsupportedDateTimeField for a specific named field. Names should be of standard format, such as 'monthOfYear' or 'hourOfDay'. The returned instance is cached.
Parameters:
type - the type to obtain
Returns:
the instance

getLeapAmount

public int getLeapAmount(long instant)
Always throws UnsupportedOperationException
Overrides:
getLeapAmount in interface DateTimeField

getLeapDurationField

public DurationField getLeapDurationField()
Always returns null.
Overrides:
getLeapDurationField in interface DateTimeField
Returns:
null always

getMaximumShortTextLength

public int getMaximumShortTextLength(Locale locale)
Always throws UnsupportedOperationException
Overrides:
getMaximumShortTextLength in interface DateTimeField

getMaximumTextLength

public int getMaximumTextLength(Locale locale)
Always throws UnsupportedOperationException
Overrides:
getMaximumTextLength in interface DateTimeField

getMaximumValue

public int getMaximumValue()
Always throws UnsupportedOperationException
Overrides:
getMaximumValue in interface DateTimeField

getMaximumValue

public int getMaximumValue(long instant)
Always throws UnsupportedOperationException
Overrides:
getMaximumValue in interface DateTimeField

getMaximumValue

public int getMaximumValue(ReadablePartial instant)
Always throws UnsupportedOperationException
Overrides:
getMaximumValue in interface DateTimeField

getMaximumValue

public int getMaximumValue(ReadablePartial instant,
                           int[] values)
Always throws UnsupportedOperationException
Overrides:
getMaximumValue in interface DateTimeField

getMinimumValue

public int getMinimumValue()
Always throws UnsupportedOperationException
Overrides:
getMinimumValue in interface DateTimeField

getMinimumValue

public int getMinimumValue(long instant)
Always throws UnsupportedOperationException
Overrides:
getMinimumValue in interface DateTimeField

getMinimumValue

public int getMinimumValue(ReadablePartial instant)
Always throws UnsupportedOperationException
Overrides:
getMinimumValue in interface DateTimeField

getMinimumValue

public int getMinimumValue(ReadablePartial instant,
                           int[] values)
Always throws UnsupportedOperationException
Overrides:
getMinimumValue in interface DateTimeField

getName

public String getName()
Get the name of the field.

By convention, names follow a pattern of "dddOfRrr", where "ddd" represents the (singular) duration unit field name and "Rrr" represents the (singular) duration range field name. If the range field is not applicable, then the name of the field is simply the (singular) duration field name.

Overrides:
getName in interface DateTimeField
Returns:
field name

getRangeDurationField

public DurationField getRangeDurationField()
Always returns null.
Overrides:
getRangeDurationField in interface DateTimeField
Returns:
null always

getType

public DateTimeFieldType getType()
Get the type of the field.
Overrides:
getType in interface DateTimeField
Returns:
field type

isLeap

public boolean isLeap(long instant)
Always throws UnsupportedOperationException
Overrides:
isLeap in interface DateTimeField

isLenient

public boolean isLenient()
This field is not lenient.
Overrides:
isLenient in interface DateTimeField
Returns:
false always

isSupported

public boolean isSupported()
This field is not supported.
Overrides:
isSupported in interface DateTimeField
Returns:
false always

remainder

public long remainder(long instant)
Always throws UnsupportedOperationException
Overrides:
remainder in interface DateTimeField

roundCeiling

public long roundCeiling(long instant)
Always throws UnsupportedOperationException
Overrides:
roundCeiling in interface DateTimeField

roundFloor

public long roundFloor(long instant)
Always throws UnsupportedOperationException
Overrides:
roundFloor in interface DateTimeField

roundHalfCeiling

public long roundHalfCeiling(long instant)
Always throws UnsupportedOperationException
Overrides:
roundHalfCeiling in interface DateTimeField

roundHalfEven

public long roundHalfEven(long instant)
Always throws UnsupportedOperationException
Overrides:
roundHalfEven in interface DateTimeField

roundHalfFloor

public long roundHalfFloor(long instant)
Always throws UnsupportedOperationException
Overrides:
roundHalfFloor in interface DateTimeField

set

public long set(long instant,
                String text)
Always throws UnsupportedOperationException
Overrides:
set in interface DateTimeField

set

public long set(long instant,
                String text,
                Locale locale)
Always throws UnsupportedOperationException
Overrides:
set in interface DateTimeField

set

public long set(long instant,
                int value)
Always throws UnsupportedOperationException
Overrides:
set in interface DateTimeField

set

public int[] set(ReadablePartial instant,
                 int fieldIndex,
                 int[] values,
                 String text,
                 Locale locale)
Always throws UnsupportedOperationException
Overrides:
set in interface DateTimeField

set

public int[] set(ReadablePartial instant,
                 int fieldIndex,
                 int[] values,
                 int newValue)
Always throws UnsupportedOperationException
Overrides:
set in interface DateTimeField

toString

public String toString()
Get a suitable debug string.
Overrides:
toString in interface DateTimeField
Returns:
debug string

Copyright (c) 2001-2006 - Joda.org