Java Doc for BaseDateTimeField.java in  » Development » Joda-Time » org » joda » time » field » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » Joda Time » org.joda.time.field 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.joda.time.DateTimeField
      org.joda.time.field.BaseDateTimeField

All known Subclasses:   org.joda.time.field.DecoratedDateTimeField,  org.joda.time.chrono.GJEraDateTimeField,  org.joda.time.field.PreciseDurationDateTimeField,  org.joda.time.field.ImpreciseDateTimeField,  org.joda.time.chrono.BasicSingleEraDateTimeField,
BaseDateTimeField
abstract public class BaseDateTimeField extends DateTimeField (Code)
BaseDateTimeField provides the common behaviour for DateTimeField implementations.

This class should generally not be used directly by API users. The DateTimeField class should be used when different kinds of DateTimeField objects are to be referenced.

BaseDateTimeField is thread-safe and immutable, and its subclasses must be as well.
author:
   Brian S O'Neill
since:
   1.0
See Also:   DecoratedDateTimeField




Constructor Summary
protected  BaseDateTimeField(DateTimeFieldType type)
     Constructor.

Method Summary
public  longadd(long instant, int value)
     Adds a value (which may be negative) to the instant value, overflowing into larger fields if necessary.

The value will be added to this field.

public  longadd(long instant, long value)
     Adds a value (which may be negative) to the instant value, overflowing into larger fields if necessary.
public  int[]add(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)
     Adds a value (which may be negative) to the partial instant, throwing an exception if the maximum size of the instant is reached.

The value will be added to this field, overflowing into larger fields if necessary.

public  longaddWrapField(long instant, int value)
     Adds a value (which may be negative) to the instant value, wrapping within this field.

The value will be added to this field.

public  int[]addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)
     Adds a value (which may be negative) to the partial instant, wrapping within this field.

The value will be added to this field.

public  int[]addWrapPartial(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)
     Adds a value (which may be negative) to the partial instant, wrapping the whole partial if the maximum size of the partial is reached.

The value will be added to this field, overflowing into larger fields if necessary.

protected  intconvertText(String text, Locale locale)
     Convert the specified text and locale into a value.
abstract public  intget(long instant)
     Get the value of this field from the milliseconds.
public  StringgetAsShortText(long instant, Locale locale)
     Get the human-readable, short text value of this field from the milliseconds.
final public  StringgetAsShortText(long instant)
     Get the human-readable, short text value of this field from the milliseconds.
public  StringgetAsShortText(ReadablePartial partial, int fieldValue, Locale locale)
     Get the human-readable, short text value of this field from a partial instant.
final public  StringgetAsShortText(ReadablePartial partial, Locale locale)
     Get the human-readable, short text value of this field from a partial instant.
public  StringgetAsShortText(int fieldValue, Locale locale)
     Get the human-readable, short text value of this field from the field value.
public  StringgetAsText(long instant, Locale locale)
     Get the human-readable, text value of this field from the milliseconds.
final public  StringgetAsText(long instant)
     Get the human-readable, text value of this field from the milliseconds.
public  StringgetAsText(ReadablePartial partial, int fieldValue, Locale locale)
     Get the human-readable, text value of this field from a partial instant.
final public  StringgetAsText(ReadablePartial partial, Locale locale)
     Get the human-readable, text value of this field from a partial instant.
public  StringgetAsText(int fieldValue, Locale locale)
     Get the human-readable, text value of this field from the field value.
public  intgetDifference(long minuendInstant, long subtrahendInstant)
     Computes the difference between two instants, as measured in the units of this field.
public  longgetDifferenceAsLong(long minuendInstant, long subtrahendInstant)
     Computes the difference between two instants, as measured in the units of this field.
abstract public  DurationFieldgetDurationField()
     Returns the duration per unit value of this field.
public  intgetLeapAmount(long instant)
     Gets the amount by which this field is 'leap' for the specified instant.
public  DurationFieldgetLeapDurationField()
     If this field were to leap, then it would be in units described by the returned duration.
public  intgetMaximumShortTextLength(Locale locale)
     Get the maximum short text value for this field.
public  intgetMaximumTextLength(Locale locale)
     Get the maximum text value for this field.
abstract public  intgetMaximumValue()
     Get the maximum allowable value for this field.
public  intgetMaximumValue(long instant)
     Get the maximum value for this field evaluated at the specified time.
public  intgetMaximumValue(ReadablePartial instant)
     Get the maximum value for this field evaluated at the specified instant.
public  intgetMaximumValue(ReadablePartial instant, int[] values)
     Get the maximum value for this field using the partial instant and the specified values.
abstract public  intgetMinimumValue()
     Get the minimum allowable value for this field.
public  intgetMinimumValue(long instant)
     Get the minimum value for this field evaluated at the specified time.
public  intgetMinimumValue(ReadablePartial instant)
     Get the minimum value for this field evaluated at the specified instant.
public  intgetMinimumValue(ReadablePartial instant, int[] values)
     Get the minimum value for this field using the partial instant and the specified values.
final public  StringgetName()
    
abstract public  DurationFieldgetRangeDurationField()
     Returns the range duration of this field.
final public  DateTimeFieldTypegetType()
    
public  booleanisLeap(long instant)
     Returns whether this field is 'leap' for the specified instant.
final public  booleanisSupported()
    
public  longremainder(long instant)
     Returns the fractional duration milliseconds of this field.
public  longroundCeiling(long instant)
     Round to the highest whole unit of this field.
abstract public  longroundFloor(long instant)
     Round to the lowest whole unit of this field.
public  longroundHalfCeiling(long instant)
     Round to the nearest whole unit of this field.
public  longroundHalfEven(long instant)
     Round to the nearest whole unit of this field.
public  longroundHalfFloor(long instant)
     Round to the nearest whole unit of this field.
abstract public  longset(long instant, int value)
     Sets a value in the milliseconds supplied.

The value of this field will be set. If the value is invalid, an exception if thrown.

If setting this field would make other fields invalid, then those fields may be changed.

public  int[]set(ReadablePartial partial, int fieldIndex, int[] values, int newValue)
     Sets a value using the specified partial instant.

The value of this field (specified by the index) will be set. If the value is invalid, an exception if thrown.

If setting this field would make other fields invalid, then those fields may be changed.

public  longset(long instant, String text, Locale locale)
     Sets a value in the milliseconds supplied from a human-readable, text value.
final public  longset(long instant, String text)
     Sets a value in the milliseconds supplied from a human-readable, text value.
public  int[]set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale)
     Sets a value in the milliseconds supplied from a human-readable, text value.
public  StringtoString()
     Get a suitable debug string.


Constructor Detail
BaseDateTimeField
protected BaseDateTimeField(DateTimeFieldType type)(Code)
Constructor.




Method Detail
add
public long add(long instant, int value)(Code)
Adds a value (which may be negative) to the instant value, overflowing into larger fields if necessary.

The value will be added to this field. If the value is too large to be added solely to this field, larger fields will increase as required. Smaller fields should be unaffected, except where the result would be an invalid value for a smaller field. In this case the smaller field is adjusted to be in range.

For example, in the ISO chronology:
2000-08-20 add six months is 2001-02-20
2000-08-20 add twenty months is 2002-04-20
2000-08-20 add minus nine months is 1999-11-20
2001-01-31 add one month is 2001-02-28
2001-01-31 add two months is 2001-03-31

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




add
public long add(long instant, long value)(Code)
Adds a value (which may be negative) to the instant value, overflowing into larger fields if necessary.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to add to
Parameters:
  value - the long value to add, in the units of the field the updated milliseconds
throws:
  IllegalArgumentException - if value is too large
See Also:   BaseDateTimeField.add(long,int)



add
public int[] add(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)(Code)
Adds a value (which may be negative) to the partial instant, throwing an exception if the maximum size of the instant is reached.

The value will be added to this field, overflowing into larger fields if necessary. Smaller fields should be unaffected, except where the result would be an invalid value for a smaller field. In this case the smaller field is adjusted to be in range.

Partial instants only contain some fields. This may result in a maximum possible value, such as TimeOfDay being limited to 23:59:59:999. If this limit is breached by the add an exception is thrown.

For example, in the ISO chronology:
2000-08-20 add six months is 2000-02-20
2000-08-20 add twenty months is 2000-04-20
2000-08-20 add minus nine months is 2000-11-20
2001-01-31 add one month is 2001-02-28
2001-01-31 add two months is 2001-03-31

Parameters:
  instant - the partial instant
Parameters:
  fieldIndex - the index of this field in the partial
Parameters:
  values - the values of the partial instant which should be updated
Parameters:
  valueToAdd - the value to add, in the units of the field the passed in values
throws:
  IllegalArgumentException - if the value is invalid or the maximum instant is reached




addWrapField
public long addWrapField(long instant, int value)(Code)
Adds a value (which may be negative) to the instant value, wrapping within this field.

The value will be added to this field. If the value is too large to be added solely to this field then it wraps. Larger fields are always unaffected. Smaller fields should be unaffected, except where the result would be an invalid value for a smaller field. In this case the smaller field is adjusted to be in range.

For example, in the ISO chronology:
2000-08-20 addWrapField six months is 2000-02-20
2000-08-20 addWrapField twenty months is 2000-04-20
2000-08-20 addWrapField minus nine months is 2000-11-20
2001-01-31 addWrapField one month is 2001-02-28
2001-01-31 addWrapField two months is 2001-03-31

The default implementation internally calls set. Subclasses are encouraged to provide a more efficient implementation.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to add to
Parameters:
  value - the value to add, in the units of the field the updated milliseconds




addWrapField
public int[] addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)(Code)
Adds a value (which may be negative) to the partial instant, wrapping within this field.

The value will be added to this field. If the value is too large to be added solely to this field then it wraps. Larger fields are always unaffected. Smaller fields should be unaffected, except where the result would be an invalid value for a smaller field. In this case the smaller field is adjusted to be in range.

For example, in the ISO chronology:
2000-08-20 addWrapField six months is 2000-02-20
2000-08-20 addWrapField twenty months is 2000-04-20
2000-08-20 addWrapField minus nine months is 2000-11-20
2001-01-31 addWrapField one month is 2001-02-28
2001-01-31 addWrapField two months is 2001-03-31

The default implementation internally calls set. Subclasses are encouraged to provide a more efficient implementation.
Parameters:
  instant - the partial instant
Parameters:
  fieldIndex - the index of this field in the instant
Parameters:
  values - the values of the partial instant which should be updated
Parameters:
  valueToAdd - the value to add, in the units of the field the passed in values
throws:
  IllegalArgumentException - if the value is invalid




addWrapPartial
public int[] addWrapPartial(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)(Code)
Adds a value (which may be negative) to the partial instant, wrapping the whole partial if the maximum size of the partial is reached.

The value will be added to this field, overflowing into larger fields if necessary. Smaller fields should be unaffected, except where the result would be an invalid value for a smaller field. In this case the smaller field is adjusted to be in range.

Partial instants only contain some fields. This may result in a maximum possible value, such as TimeOfDay normally being limited to 23:59:59:999. If ths limit is reached by the addition, this method will wrap back to 00:00:00.000. In fact, you would generally only use this method for classes that have a limitation such as this.

For example, in the ISO chronology:
10:20:30 add 20 minutes is 10:40:30
10:20:30 add 45 minutes is 11:05:30
10:20:30 add 16 hours is 02:20:30

Parameters:
  instant - the partial instant
Parameters:
  fieldIndex - the index of this field in the partial
Parameters:
  values - the values of the partial instant which should be updated
Parameters:
  valueToAdd - the value to add, in the units of the field the passed in values
throws:
  IllegalArgumentException - if the value is invalid or the maximum instant is reached




convertText
protected int convertText(String text, Locale locale)(Code)
Convert the specified text and locale into a value.
Parameters:
  text - the text to convert
Parameters:
  locale - the locale to convert using the value extracted from the text
throws:
  IllegalArgumentException - if the text is invalid



get
abstract public int get(long instant)(Code)
Get the value of this field from the milliseconds.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to query the value of the field, in the units of the field



getAsShortText
public String getAsShortText(long instant, Locale locale)(Code)
Get the human-readable, short text value of this field from the milliseconds. If the specified locale is null, the default locale is used.

The default implementation returns getAsShortText(get(instant), locale).
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to query
Parameters:
  locale - the locale to use for selecting a text symbol, null means default the text value of the field




getAsShortText
final public String getAsShortText(long instant)(Code)
Get the human-readable, short text value of this field from the milliseconds.

The default implementation calls BaseDateTimeField.getAsShortText(long,Locale) .
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to query the text value of the field




getAsShortText
public String getAsShortText(ReadablePartial partial, int fieldValue, Locale locale)(Code)
Get the human-readable, short text value of this field from a partial instant. If the specified locale is null, the default locale is used.

The default implementation returns getAsShortText(fieldValue, locale).
Parameters:
  partial - the partial instant to query
Parameters:
  fieldValue - the field value of this field, provided for performance
Parameters:
  locale - the locale to use for selecting a text symbol, null for default the text value of the field




getAsShortText
final public String getAsShortText(ReadablePartial partial, Locale locale)(Code)
Get the human-readable, short text value of this field from a partial instant. If the specified locale is null, the default locale is used.

The default implementation calls ReadablePartial.get(DateTimeFieldType) and BaseDateTimeField.getAsText(ReadablePartial,int,Locale) .
Parameters:
  partial - the partial instant to query
Parameters:
  locale - the locale to use for selecting a text symbol, null for default the text value of the field




getAsShortText
public String getAsShortText(int fieldValue, Locale locale)(Code)
Get the human-readable, short text value of this field from the field value. If the specified locale is null, the default locale is used.

The default implementation returns getAsText(fieldValue, locale).

Note: subclasses that override this method should also override getMaximumShortTextLength.
Parameters:
  fieldValue - the numeric value to convert to text
Parameters:
  locale - the locale to use for selecting a text symbol, null for default the text value of the field




getAsText
public String getAsText(long instant, Locale locale)(Code)
Get the human-readable, text value of this field from the milliseconds. If the specified locale is null, the default locale is used.

The default implementation returns getAsText(get(instant), locale).
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to query
Parameters:
  locale - the locale to use for selecting a text symbol, null means default the text value of the field




getAsText
final public String getAsText(long instant)(Code)
Get the human-readable, text value of this field from the milliseconds.

The default implementation calls BaseDateTimeField.getAsText(long,Locale) .
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to query the text value of the field




getAsText
public String getAsText(ReadablePartial partial, int fieldValue, Locale locale)(Code)
Get the human-readable, text value of this field from a partial instant. If the specified locale is null, the default locale is used.

The default implementation returns getAsText(fieldValue, locale).
Parameters:
  partial - the partial instant to query
Parameters:
  fieldValue - the field value of this field, provided for performance
Parameters:
  locale - the locale to use for selecting a text symbol, null for default the text value of the field




getAsText
final public String getAsText(ReadablePartial partial, Locale locale)(Code)
Get the human-readable, text value of this field from a partial instant. If the specified locale is null, the default locale is used.

The default implementation calls ReadablePartial.get(DateTimeFieldType) and BaseDateTimeField.getAsText(ReadablePartial,int,Locale) .
Parameters:
  partial - the partial instant to query
Parameters:
  locale - the locale to use for selecting a text symbol, null for default the text value of the field




getAsText
public String getAsText(int fieldValue, Locale locale)(Code)
Get the human-readable, text value of this field from the field value. If the specified locale is null, the default locale is used.

The default implementation returns Integer.toString(get(instant)).

Note: subclasses that override this method should also override getMaximumTextLength.
Parameters:
  fieldValue - the numeric value to convert to text
Parameters:
  locale - the locale to use for selecting a text symbol, null for default the text value of the field




getDifference
public int getDifference(long minuendInstant, long subtrahendInstant)(Code)
Computes the difference between two instants, as measured in the units of this field. Any fractional units are dropped from the result. Calling getDifference reverses the effect of calling add. In the following code:
 long instant = ...
 int v = ...
 int age = getDifference(add(instant, v), instant);
 
The value 'age' is the same as the value 'v'.
Parameters:
  minuendInstant - the milliseconds from 1970-01-01T00:00:00Z tosubtract from
Parameters:
  subtrahendInstant - the milliseconds from 1970-01-01T00:00:00Z tosubtract off the minuend the difference in the units of this field



getDifferenceAsLong
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant)(Code)
Computes the difference between two instants, as measured in the units of this field. Any fractional units are dropped from the result. Calling getDifference reverses the effect of calling add. In the following code:
 long instant = ...
 long v = ...
 long age = getDifferenceAsLong(add(instant, v), instant);
 
The value 'age' is the same as the value 'v'.
Parameters:
  minuendInstant - the milliseconds from 1970-01-01T00:00:00Z tosubtract from
Parameters:
  subtrahendInstant - the milliseconds from 1970-01-01T00:00:00Z tosubtract off the minuend the difference in the units of this field



getDurationField
abstract public DurationField getDurationField()(Code)
Returns the duration per unit value of this field. For example, if this field represents "hour of day", then the unit duration is an hour. the duration of this field, or UnsupportedDurationField if fieldhas no duration



getLeapAmount
public int getLeapAmount(long instant)(Code)
Gets the amount by which this field is 'leap' for the specified instant.

For example, a leap year would return one, a non leap year would return zero.

This implementation returns zero.




getLeapDurationField
public DurationField getLeapDurationField()(Code)
If this field were to leap, then it would be in units described by the returned duration. If this field doesn't ever leap, null is returned.

This implementation returns null.




getMaximumShortTextLength
public int getMaximumShortTextLength(Locale locale)(Code)
Get the maximum short text value for this field. The default implementation returns getMaximumTextLength().
Parameters:
  locale - the locale to use for selecting a text symbol the maximum short text length



getMaximumTextLength
public int getMaximumTextLength(Locale locale)(Code)
Get the maximum text value for this field. The default implementation returns the equivalent of Integer.toString(getMaximumValue()).length().
Parameters:
  locale - the locale to use for selecting a text symbol the maximum text length



getMaximumValue
abstract public int getMaximumValue()(Code)
Get the maximum allowable value for this field. the maximum valid value for this field, in the units of thefield



getMaximumValue
public int getMaximumValue(long instant)(Code)
Get the maximum value for this field evaluated at the specified time.

This implementation returns the same as BaseDateTimeField.getMaximumValue() .
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to query the maximum value for this field, in the units of the field




getMaximumValue
public int getMaximumValue(ReadablePartial instant)(Code)
Get the maximum value for this field evaluated at the specified instant.

This implementation returns the same as BaseDateTimeField.getMaximumValue() .
Parameters:
  instant - the partial instant to query the maximum value for this field, in the units of the field




getMaximumValue
public int getMaximumValue(ReadablePartial instant, int[] values)(Code)
Get the maximum value for this field using the partial instant and the specified values.

This implementation returns the same as BaseDateTimeField.getMaximumValue(ReadablePartial) .
Parameters:
  instant - the partial instant to query
Parameters:
  values - the values to use the maximum value for this field, in the units of the field




getMinimumValue
abstract public int getMinimumValue()(Code)
Get the minimum allowable value for this field. the minimum valid value for this field, in the units of thefield



getMinimumValue
public int getMinimumValue(long instant)(Code)
Get the minimum value for this field evaluated at the specified time.

This implementation returns the same as BaseDateTimeField.getMinimumValue() .
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to query the minimum value for this field, in the units of the field




getMinimumValue
public int getMinimumValue(ReadablePartial instant)(Code)
Get the minimum value for this field evaluated at the specified instant.

This implementation returns the same as BaseDateTimeField.getMinimumValue() .
Parameters:
  instant - the partial instant to query the minimum value for this field, in the units of the field




getMinimumValue
public int getMinimumValue(ReadablePartial instant, int[] values)(Code)
Get the minimum value for this field using the partial instant and the specified values.

This implementation returns the same as BaseDateTimeField.getMinimumValue(ReadablePartial) .
Parameters:
  instant - the partial instant to query
Parameters:
  values - the values to use the minimum value for this field, in the units of the field




getName
final public String getName()(Code)



getRangeDurationField
abstract public DurationField getRangeDurationField()(Code)
Returns the range duration of this field. For example, if this field represents "hour of day", then the range duration is a day. the range duration of this field, or null if field has no range



getType
final public DateTimeFieldType getType()(Code)



isLeap
public boolean isLeap(long instant)(Code)
Returns whether this field is 'leap' for the specified instant.

For example, a leap year would return true, a non leap year would return false.

This implementation returns false. true if the field is 'leap'




isSupported
final public boolean isSupported()(Code)
true always



remainder
public long remainder(long instant)(Code)
Returns the fractional duration milliseconds of this field. In other words, calling remainder returns the duration that roundFloor would subtract.

For example, on a datetime of 2002-11-02T23:34:56.789, the remainder by hour is 34 minutes and 56.789 seconds.

The default implementation computes instant - roundFloor(instant). Subclasses are encouraged to provide a more efficient implementation.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to get theremainder remainder duration, in milliseconds




roundCeiling
public long roundCeiling(long instant)(Code)
Round to the highest whole unit of this field. The value of this field and all fields of a higher magnitude may be incremented in order to achieve this result. The fractional millis that cannot be expressed in whole increments of this field are set to minimum.

For example, a datetime of 2002-11-02T23:34:56.789, rounded to the highest whole hour is 2002-11-03T00:00:00.000.

The default implementation calls roundFloor, and if the instant is modified as a result, adds one field unit. Subclasses are encouraged to provide a more efficient implementation.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to round rounded milliseconds




roundFloor
abstract public long roundFloor(long instant)(Code)
Round to the lowest whole unit of this field. After rounding, the value of this field and all fields of a higher magnitude are retained. The fractional millis that cannot be expressed in whole increments of this field are set to minimum.

For example, a datetime of 2002-11-02T23:34:56.789, rounded to the lowest whole hour is 2002-11-02T23:00:00.000.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to round rounded milliseconds




roundHalfCeiling
public long roundHalfCeiling(long instant)(Code)
Round to the nearest whole unit of this field. If the given millisecond value is closer to the floor, this function behaves like roundFloor. If the millisecond value is closer to the ceiling or is exactly halfway, this function behaves like roundCeiling.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to round rounded milliseconds



roundHalfEven
public long roundHalfEven(long instant)(Code)
Round to the nearest whole unit of this field. If the given millisecond value is closer to the floor, this function behaves like roundFloor. If the millisecond value is closer to the ceiling, this function behaves like roundCeiling.

If the millisecond value is exactly halfway between the floor and ceiling, the ceiling is chosen over the floor only if it makes this field's value even.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to round rounded milliseconds




roundHalfFloor
public long roundHalfFloor(long instant)(Code)
Round to the nearest whole unit of this field. If the given millisecond value is closer to the floor or is exactly halfway, this function behaves like roundFloor. If the millisecond value is closer to the ceiling, this function behaves like roundCeiling.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to round rounded milliseconds



set
abstract public long set(long instant, int value)(Code)
Sets a value in the milliseconds supplied.

The value of this field will be set. If the value is invalid, an exception if thrown.

If setting this field would make other fields invalid, then those fields may be changed. For example if the current date is the 31st January, and the month is set to February, the day would be invalid. Instead, the day would be changed to the closest value - the 28th/29th February as appropriate.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to set in
Parameters:
  value - the value to set, in the units of the field the updated milliseconds
throws:
  IllegalArgumentException - if the value is invalid




set
public int[] set(ReadablePartial partial, int fieldIndex, int[] values, int newValue)(Code)
Sets a value using the specified partial instant.

The value of this field (specified by the index) will be set. If the value is invalid, an exception if thrown.

If setting this field would make other fields invalid, then those fields may be changed. For example if the current date is the 31st January, and the month is set to February, the day would be invalid. Instead, the day would be changed to the closest value - the 28th/29th February as appropriate.
Parameters:
  partial - the partial instant
Parameters:
  fieldIndex - the index of this field in the instant
Parameters:
  values - the values to update
Parameters:
  newValue - the value to set, in the units of the field the updated values
throws:
  IllegalArgumentException - if the value is invalid




set
public long set(long instant, String text, Locale locale)(Code)
Sets a value in the milliseconds supplied from a human-readable, text value. If the specified locale is null, the default locale is used.

This implementation uses convertText(String, Locale) and BaseDateTimeField.set(long,int) .

Note: subclasses that override this method should also override getAsText.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to set in
Parameters:
  text - the text value to set
Parameters:
  locale - the locale to use for selecting a text symbol, null for default the updated milliseconds
throws:
  IllegalArgumentException - if the text value is invalid




set
final public long set(long instant, String text)(Code)
Sets a value in the milliseconds supplied from a human-readable, text value.

This implementation uses BaseDateTimeField.set(long,String,Locale) .

Note: subclasses that override this method should also override getAsText.
Parameters:
  instant - the milliseconds from 1970-01-01T00:00:00Z to set in
Parameters:
  text - the text value to set the updated milliseconds
throws:
  IllegalArgumentException - if the text value is invalid




set
public int[] set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale)(Code)
Sets a value in the milliseconds supplied from a human-readable, text value. If the specified locale is null, the default locale is used.

This implementation uses convertText(String, Locale) and BaseDateTimeField.set(ReadablePartial,int,int[],int) .
Parameters:
  instant - the partial instant
Parameters:
  fieldIndex - the index of this field in the instant
Parameters:
  values - the values of the partial instant which should be updated
Parameters:
  text - the text value to set
Parameters:
  locale - the locale to use for selecting a text symbol, null for default the passed in values
throws:
  IllegalArgumentException - if the text value is invalid




toString
public String toString()(Code)
Get a suitable debug string. debug string



Methods inherited from org.joda.time.DateTimeField
abstract public long add(long instant, int value)(Code)(Java Doc)
abstract public long add(long instant, long value)(Code)(Java Doc)
abstract public int[] add(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)(Code)(Java Doc)
abstract public long addWrapField(long instant, int value)(Code)(Java Doc)
abstract public int[] addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)(Code)(Java Doc)
abstract public int[] addWrapPartial(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd)(Code)(Java Doc)
abstract public int get(long instant)(Code)(Java Doc)
abstract public String getAsShortText(long instant, Locale locale)(Code)(Java Doc)
abstract public String getAsShortText(long instant)(Code)(Java Doc)
abstract public String getAsShortText(ReadablePartial partial, int fieldValue, Locale locale)(Code)(Java Doc)
abstract public String getAsShortText(ReadablePartial partial, Locale locale)(Code)(Java Doc)
abstract public String getAsShortText(int fieldValue, Locale locale)(Code)(Java Doc)
abstract public String getAsText(long instant, Locale locale)(Code)(Java Doc)
abstract public String getAsText(long instant)(Code)(Java Doc)
abstract public String getAsText(ReadablePartial partial, int fieldValue, Locale locale)(Code)(Java Doc)
abstract public String getAsText(ReadablePartial partial, Locale locale)(Code)(Java Doc)
abstract public String getAsText(int fieldValue, Locale locale)(Code)(Java Doc)
abstract public int getDifference(long minuendInstant, long subtrahendInstant)(Code)(Java Doc)
abstract public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant)(Code)(Java Doc)
abstract public DurationField getDurationField()(Code)(Java Doc)
abstract public int getLeapAmount(long instant)(Code)(Java Doc)
abstract public DurationField getLeapDurationField()(Code)(Java Doc)
abstract public int getMaximumShortTextLength(Locale locale)(Code)(Java Doc)
abstract public int getMaximumTextLength(Locale locale)(Code)(Java Doc)
abstract public int getMaximumValue()(Code)(Java Doc)
abstract public int getMaximumValue(long instant)(Code)(Java Doc)
abstract public int getMaximumValue(ReadablePartial instant)(Code)(Java Doc)
abstract public int getMaximumValue(ReadablePartial instant, int[] values)(Code)(Java Doc)
abstract public int getMinimumValue()(Code)(Java Doc)
abstract public int getMinimumValue(long instant)(Code)(Java Doc)
abstract public int getMinimumValue(ReadablePartial instant)(Code)(Java Doc)
abstract public int getMinimumValue(ReadablePartial instant, int[] values)(Code)(Java Doc)
abstract public String getName()(Code)(Java Doc)
abstract public DurationField getRangeDurationField()(Code)(Java Doc)
abstract public DateTimeFieldType getType()(Code)(Java Doc)
abstract public boolean isLeap(long instant)(Code)(Java Doc)
abstract public boolean isLenient()(Code)(Java Doc)
abstract public boolean isSupported()(Code)(Java Doc)
abstract public long remainder(long instant)(Code)(Java Doc)
abstract public long roundCeiling(long instant)(Code)(Java Doc)
abstract public long roundFloor(long instant)(Code)(Java Doc)
abstract public long roundHalfCeiling(long instant)(Code)(Java Doc)
abstract public long roundHalfEven(long instant)(Code)(Java Doc)
abstract public long roundHalfFloor(long instant)(Code)(Java Doc)
abstract public long set(long instant, int value)(Code)(Java Doc)
abstract public int[] set(ReadablePartial instant, int fieldIndex, int[] values, int newValue)(Code)(Java Doc)
abstract public long set(long instant, String text, Locale locale)(Code)(Java Doc)
abstract public long set(long instant, String text)(Code)(Java Doc)
abstract public int[] set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale)(Code)(Java Doc)
abstract public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.