public final class

UnsupportedDurationField

extends DurationField
implements Serializable
java.lang.Object
   ↳ org.joda.time.DurationField
     ↳ org.joda.time.field.UnsupportedDurationField

Class Overview

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

UnsupportedDurationField is thread-safe and immutable.

Summary

Public Methods
long add(long instant, long value)
Always throws UnsupportedOperationException
long add(long instant, int value)
Always throws UnsupportedOperationException
int compareTo(Object durationField)
Always returns zero, indicating that sort order is not relevent.
boolean equals(Object obj)
Compares this duration field to another.
int getDifference(long minuendInstant, long subtrahendInstant)
Always throws UnsupportedOperationException
long getDifferenceAsLong(long minuendInstant, long subtrahendInstant)
Always throws UnsupportedOperationException
synchronized static UnsupportedDurationField getInstance(DurationFieldType type)
Gets an instance of UnsupportedDurationField for a specific named field.
long getMillis(long value, long instant)
Always throws UnsupportedOperationException
long getMillis(int value)
Always throws UnsupportedOperationException
long getMillis(int value, long instant)
Always throws UnsupportedOperationException
long getMillis(long value)
Always throws UnsupportedOperationException
String getName()
Get the name of the field.
final DurationFieldType getType()
Get the type of the field.
long getUnitMillis()
Always returns zero.
int getValue(long duration)
Always throws UnsupportedOperationException
int getValue(long duration, long instant)
Always throws UnsupportedOperationException
long getValueAsLong(long duration)
Always throws UnsupportedOperationException
long getValueAsLong(long duration, long instant)
Always throws UnsupportedOperationException
int hashCode()
Gets a suitable hashcode.
boolean isPrecise()
This field is precise.
boolean isSupported()
This field is not supported.
String toString()
Get a suitable debug string.
[Expand]
Inherited Methods
From class org.joda.time.DurationField
From class java.lang.Object
From interface java.lang.Comparable

Public Methods

public long add (long instant, long value)

Always throws UnsupportedOperationException

Parameters
instant the milliseconds from 1970-01-01T00:00:00Z to add to
value the value to add, in the units of the field
Returns
  • the updated milliseconds

public long add (long instant, int value)

Always throws UnsupportedOperationException

Parameters
instant the milliseconds from 1970-01-01T00:00:00Z to add to
value the value to add, in the units of the field
Returns
  • the updated milliseconds

public int compareTo (Object durationField)

Always returns zero, indicating that sort order is not relevent.

Parameters
durationField a duration field to check against
Returns
  • zero always

public boolean equals (Object obj)

Compares this duration field to another.

Parameters
obj the object to compare to
Returns
  • true if equal

public int getDifference (long minuendInstant, long subtrahendInstant)

Always throws UnsupportedOperationException

Parameters
minuendInstant the milliseconds from 1970-01-01T00:00:00Z to subtract from
subtrahendInstant the milliseconds from 1970-01-01T00:00:00Z to subtract off the minuend
Returns
  • the difference in the units of this field

public long getDifferenceAsLong (long minuendInstant, long subtrahendInstant)

Always throws UnsupportedOperationException

Parameters
minuendInstant the milliseconds from 1970-01-01T00:00:00Z to subtract from
subtrahendInstant the milliseconds from 1970-01-01T00:00:00Z to subtract off the minuend
Returns
  • the difference in the units of this field

public static synchronized UnsupportedDurationField getInstance (DurationFieldType type)

Gets an instance of UnsupportedDurationField for a specific named field. The returned instance is cached.

Parameters
type the type to obtain
Returns
  • the instance

public long getMillis (long value, long instant)

Always throws UnsupportedOperationException

Parameters
value the value of the field, which may be negative
instant the instant to calculate relative to
Returns
  • the millisecond duration that the field represents, which may be negative

public long getMillis (int value)

Always throws UnsupportedOperationException

Parameters
value the value of the field, which may be negative
Returns
  • the milliseconds that the field represents, which may be negative

public long getMillis (int value, long instant)

Always throws UnsupportedOperationException

Parameters
value the value of the field, which may be negative
instant the instant to calculate relative to
Returns
  • the millisecond duration that the field represents, which may be negative

public long getMillis (long value)

Always throws UnsupportedOperationException

Parameters
value the value of the field, which may be negative
Returns
  • the milliseconds that the field represents, which may be negative

public String getName ()

Get the name of the field.

By convention, names are plural.

Returns
  • field name

public final DurationFieldType getType ()

Get the type of the field.

Returns
  • field type

public long getUnitMillis ()

Always returns zero.

Returns
  • zero always

public int getValue (long duration)

Always throws UnsupportedOperationException

Parameters
duration the milliseconds to query, which may be negative
Returns
  • the value of the field, in the units of the field, which may be negative

public int getValue (long duration, long instant)

Always throws UnsupportedOperationException

Parameters
duration the milliseconds to query, which may be negative
instant the start instant to calculate relative to
Returns
  • the value of the field, in the units of the field, which may be negative

public long getValueAsLong (long duration)

Always throws UnsupportedOperationException

Parameters
duration the milliseconds to query, which may be negative
Returns
  • the value of the field, in the units of the field, which may be negative

public long getValueAsLong (long duration, long instant)

Always throws UnsupportedOperationException

Parameters
duration the milliseconds to query, which may be negative
instant the start instant to calculate relative to
Returns
  • the value of the field, in the units of the field, which may be negative

public int hashCode ()

Gets a suitable hashcode.

Returns
  • the hashcode

public boolean isPrecise ()

This field is precise.

Returns
  • true always

public boolean isSupported ()

This field is not supported.

Returns
  • false always

public String toString ()

Get a suitable debug string.

Returns
  • debug string