org.joda.time
Interface ReadableDateTime

All Superinterfaces:
java.lang.Comparable, ReadableInstant
All Known Subinterfaces:
ReadWritableDateTime
All Known Implementing Classes:
AbstractDateTime, BaseDateTime, DateMidnight, DateTime, MutableDateTime

public interface ReadableDateTime
extends ReadableInstant

Defines an instant in time that can be queried using datetime fields.

The implementation of this interface may be mutable or immutable. This interface only gives access to retrieve data, never to change it.

Methods in your application should be defined using ReadableDateTime as a parameter if the method only wants to read the datetime, and not perform any advanced manipulations.

Since:
1.0
Author:
Stephen Colebourne, Brian S O'Neill

Method Summary
 int getCenturyOfEra()
          Get the year of era field value.
 int getDayOfMonth()
          Get the day of month field value.
 int getDayOfWeek()
          Get the day of week field value.
 int getDayOfYear()
          Get the day of year field value.
 int getEra()
          Get the era field value.
 int getHourOfDay()
          Get the hour of day field value.
 int getMillisOfDay()
          Get the millis of day field value.
 int getMillisOfSecond()
          Get the millis of second field value.
 int getMinuteOfDay()
          Get the minute of day field value.
 int getMinuteOfHour()
          Get the minute of hour field value.
 int getMonthOfYear()
          Get the month of year field value.
 int getSecondOfDay()
          Get the second of day field value.
 int getSecondOfMinute()
          Get the second of minute field value.
 int getWeekOfWeekyear()
          Get the week of weekyear field value.
 int getWeekyear()
          Get the weekyear field value.
 int getYear()
          Get the year field value.
 int getYearOfCentury()
          Get the year of century field value.
 int getYearOfEra()
          Get the year of era field value.
 DateTime toDateTime()
          Get this object as a DateTime.
 MutableDateTime toMutableDateTime()
          Get this object as a MutableDateTime, always returning a new instance.
 java.lang.String toString(java.lang.String pattern)
          Output the instant using the specified format pattern.
 java.lang.String toString(java.lang.String pattern, java.util.Locale locale)
          Output the instant using the specified format pattern.
 
Methods inherited from interface org.joda.time.ReadableInstant
compareTo, equals, get, getChronology, getMillis, getZone, hashCode, isAfter, isBefore, isEqual, isSupported, toInstant, toString
 

Method Detail

getDayOfWeek

public int getDayOfWeek()
Get the day of week field value.

The values for the day of week are defined in DateTimeConstants.

Returns:
the day of week

getDayOfMonth

public int getDayOfMonth()
Get the day of month field value.

Returns:
the day of month

getDayOfYear

public int getDayOfYear()
Get the day of year field value.

Returns:
the day of year

getWeekOfWeekyear

public int getWeekOfWeekyear()
Get the week of weekyear field value.

Returns:
the week of a week based year

getWeekyear

public int getWeekyear()
Get the weekyear field value.

Returns:
the year of a week based year

getMonthOfYear

public int getMonthOfYear()
Get the month of year field value.

Returns:
the month of year

getYear

public int getYear()
Get the year field value.

Returns:
the year

getYearOfEra

public int getYearOfEra()
Get the year of era field value.

Returns:
the year of era

getYearOfCentury

public int getYearOfCentury()
Get the year of century field value.

Returns:
the year of century

getCenturyOfEra

public int getCenturyOfEra()
Get the year of era field value.

Returns:
the year of era

getEra

public int getEra()
Get the era field value.

Returns:
the era

getMillisOfSecond

public int getMillisOfSecond()
Get the millis of second field value.

Returns:
the millis of second

getMillisOfDay

public int getMillisOfDay()
Get the millis of day field value.

Returns:
the millis of day

getSecondOfMinute

public int getSecondOfMinute()
Get the second of minute field value.

Returns:
the second of minute

getSecondOfDay

public int getSecondOfDay()
Get the second of day field value.

Returns:
the second of day

getMinuteOfHour

public int getMinuteOfHour()
Get the minute of hour field value.

Returns:
the minute of hour

getMinuteOfDay

public int getMinuteOfDay()
Get the minute of day field value.

Returns:
the minute of day

getHourOfDay

public int getHourOfDay()
Get the hour of day field value.

Returns:
the hour of day

toDateTime

public DateTime toDateTime()
Get this object as a DateTime.

If the implementation of the interface is a DateTime, it is returned directly.

Returns:
a DateTime using the same millis

toMutableDateTime

public MutableDateTime toMutableDateTime()
Get this object as a MutableDateTime, always returning a new instance.

Returns:
a MutableDateTime using the same millis

toString

public java.lang.String toString(java.lang.String pattern)
                          throws java.lang.IllegalArgumentException
Output the instant using the specified format pattern.

Parameters:
pattern - pattern specification
Throws:
java.lang.IllegalArgumentException - if pattern is invalid
See Also:
DateTimeFormat

toString

public java.lang.String toString(java.lang.String pattern,
                                 java.util.Locale locale)
                          throws java.lang.IllegalArgumentException
Output the instant using the specified format pattern.

Parameters:
pattern - pattern specification
locale - Locale to use, or null for default
Throws:
java.lang.IllegalArgumentException - if pattern is invalid
See Also:
DateTimeFormat


Copyright (c) 2001-2006 - Joda.org