public class DateFields extends Object implements Comparable, Serializable
Constructor and Description |
---|
DateFields() |
Modifier and Type | Method and Description |
---|---|
long |
addToDate(Date date)
Increment fields of date according to values in this DateFields object.
|
void |
clear()
Remove all values
|
int |
compareTo(DateFields df)
Compares this DateFields object to the one passed in.
|
int |
compareTo(Object o)
Of object is a DataFields behaves like compareTo(DateFields).
|
boolean |
equalsByIsSet(DateFields df) |
boolean |
equalsByIsSet(DateFields df,
boolean ignoreTime)
Two DateFields are equls by isSet if the the same fields are set / not
set.
|
boolean |
equalsByIsZero(DateFields df) |
boolean |
equalsByIsZero(DateFields df,
boolean ignoreTime)
Two DateFields are equls by isZero if the the same fields are zero / not
zero.
|
String |
format()
Generate text representation of these date fields.
|
int |
get(int field)
Get the value of a field
|
static String |
getFieldName(int i)
Returns text describing the name of a field
|
boolean |
isSet()
Checks if any field has a value.
|
boolean |
isSet(int field)
Checks a field to see if it has a value.
|
boolean |
isZero()
Checks if any field has a non-zero value.
|
boolean |
isZero(int field)
Checks a field to see if it has a non-zero value.
|
boolean |
overlaps(DateFields other) |
static DateFields |
parse(String interval)
Parse ISO8601 date-time format.
|
Date |
put(Date date)
Set fields of date to value of fields from this object.
|
void |
set(int field,
int value)
Set the value of a field
|
long |
substractFromDate(Date date)
Substract fields of date according to values in this DateFields object.
|
Date |
toDate()
Returns Date representation of this DateFields
|
public void clear()
public boolean isSet(int field)
Calendar
public boolean isSet()
Calendar
public boolean isZero(int field)
Calendar
public boolean isZero()
Calendar
public void set(int field, int value)
public int get(int field)
public String format()
public static DateFields parse(String interval)
public long addToDate(Date date)
date
- date to updatepublic Date toDate()
public long substractFromDate(Date date)
date
- date to updatepublic Date put(Date date)
public boolean overlaps(DateFields other)
public int compareTo(Object o)
compareTo
in interface Comparable
public int compareTo(DateFields df)
public boolean equalsByIsSet(DateFields df, boolean ignoreTime)
public boolean equalsByIsSet(DateFields df)
public boolean equalsByIsZero(DateFields df, boolean ignoreTime)
public boolean equalsByIsZero(DateFields df)
public static String getFieldName(int i)