|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.etaxonomy.cdm.model.common.TimePeriod
public class TimePeriod
| Field Summary | |
|---|---|
static org.joda.time.DateTimeFieldType |
DAY_TYPE
|
static org.joda.time.DateTimeFieldType |
MONTH_TYPE
|
static org.joda.time.DateTimeFieldType |
YEAR_TYPE
|
| Constructor Summary | |
|---|---|
protected |
TimePeriod()
Constructor |
|
TimePeriod(org.joda.time.Partial startDate)
|
|
TimePeriod(org.joda.time.Partial startDate,
org.joda.time.Partial endDate)
|
| Method Summary | |
|---|---|
static org.joda.time.Partial |
calendarToPartial(Calendar calendar)
Transforms a Calendar into a Partial |
Object |
clone()
|
boolean |
equals(Object obj)
|
org.joda.time.Partial |
getEnd()
|
Integer |
getEndDay()
|
Integer |
getEndMonth()
|
Integer |
getEndYear()
|
String |
getFreeText()
For time periods that need to store more information than the one that can be stored in start and end. |
static Integer |
getPartialValue(org.joda.time.Partial partial,
org.joda.time.DateTimeFieldType type)
|
org.joda.time.Partial |
getStart()
|
Integer |
getStartDay()
|
Integer |
getStartMonth()
|
Integer |
getStartYear()
|
String |
getYear()
|
int |
hashCode()
|
boolean |
isEmpty()
True, if there is no start date and no end date and no freetext representation exists. |
boolean |
isPeriod()
True, if this time period represents a period not a single point in time. |
static TimePeriod |
NewInstance()
Factory method |
static TimePeriod |
NewInstance(Calendar startCalendar)
Factory method to create a TimePeriod from a Calendar. |
static TimePeriod |
NewInstance(Calendar startCalendar,
Calendar endCalendar)
Factory method to create a TimePeriod from a starting and an ending Calendar |
static TimePeriod |
NewInstance(Integer year)
Factory method |
static TimePeriod |
NewInstance(Integer startYear,
Integer endYear)
Factory method |
static TimePeriod |
NewInstance(org.joda.time.Partial startDate)
Factory method |
static TimePeriod |
NewInstance(org.joda.time.Partial startDate,
org.joda.time.Partial endDate)
Factory method |
static TimePeriod |
NewInstance(org.joda.time.ReadableInstant readableInstant)
Factory method to create a TimePeriod from a ReadableInstant(e.g. |
static TimePeriod |
NewInstance(org.joda.time.ReadableInstant startInstant,
org.joda.time.ReadableInstant endInstant)
Factory method to create a TimePeriod from a starting and an ending ReadableInstant(e.g. |
protected static org.joda.time.Partial |
parseSingleDate(String singleDateString)
|
protected static org.joda.time.Partial |
parseSingleDotDate(String singleDateString)
|
static TimePeriod |
parseString(String strPeriod)
|
static TimePeriod |
parseString(TimePeriod timePeriod,
String periodString)
|
static org.joda.time.Partial |
readableInstantToPartial(org.joda.time.ReadableInstant readableInstant)
Transforms a Calendar into a Partial |
void |
setEnd(org.joda.time.Partial end)
|
TimePeriod |
setEndDay(Integer day)
|
TimePeriod |
setEndMonth(Integer month)
|
TimePeriod |
setEndYear(Integer year)
|
void |
setFreeText(String freeText)
Use parseSingleDate(String) for public use. |
static org.joda.time.Partial |
setPartialField(org.joda.time.Partial partial,
Integer value,
org.joda.time.DateTimeFieldType type)
|
void |
setStart(org.joda.time.Partial start)
|
TimePeriod |
setStartDay(Integer day)
|
TimePeriod |
setStartMonth(Integer month)
|
TimePeriod |
setStartYear(Integer year)
|
String |
toString()
Returns the getFreeText() value if free text is not null. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final org.joda.time.DateTimeFieldType MONTH_TYPE
public static final org.joda.time.DateTimeFieldType YEAR_TYPE
public static final org.joda.time.DateTimeFieldType DAY_TYPE
| Constructor Detail |
|---|
protected TimePeriod()
public TimePeriod(org.joda.time.Partial startDate)
public TimePeriod(org.joda.time.Partial startDate,
org.joda.time.Partial endDate)
| Method Detail |
|---|
public static TimePeriod NewInstance()
public static TimePeriod NewInstance(org.joda.time.Partial startDate)
public static TimePeriod NewInstance(org.joda.time.Partial startDate,
org.joda.time.Partial endDate)
public static TimePeriod NewInstance(Integer year)
public static TimePeriod NewInstance(Integer startYear,
Integer endYear)
public static TimePeriod NewInstance(Calendar startCalendar)
Calendar. The Calendar is stored as the starting instant.
public static TimePeriod NewInstance(org.joda.time.ReadableInstant readableInstant)
ReadableInstant(e.g. DateTime).
The ReadableInstant is stored as the starting instant.
public static TimePeriod NewInstance(Calendar startCalendar,
Calendar endCalendar)
Calendar
public static TimePeriod NewInstance(org.joda.time.ReadableInstant startInstant,
org.joda.time.ReadableInstant endInstant)
ReadableInstant(e.g. DateTime)
public static org.joda.time.Partial calendarToPartial(Calendar calendar)
Calendar into a Partial
calendar -
public static org.joda.time.Partial readableInstantToPartial(org.joda.time.ReadableInstant readableInstant)
Calendar into a Partial
calendar -
public boolean isPeriod()
public boolean isEmpty()
public org.joda.time.Partial getStart()
public void setStart(org.joda.time.Partial start)
public org.joda.time.Partial getEnd()
public void setEnd(org.joda.time.Partial end)
public String getFreeText()
start and end.
If free text is not null toString() will always
return the free text value.
Use toString() for public use.
- Returns:
- the freeText
public void setFreeText(String freeText)
parseSingleDate(String) for public use.
freeText - the freeText to setpublic String getYear()
public Integer getStartYear()
public Integer getStartMonth()
public Integer getStartDay()
public Integer getEndYear()
public Integer getEndMonth()
public Integer getEndDay()
public static Integer getPartialValue(org.joda.time.Partial partial,
org.joda.time.DateTimeFieldType type)
public TimePeriod setStartYear(Integer year)
public TimePeriod setStartMonth(Integer month)
throws IndexOutOfBoundsException
IndexOutOfBoundsException
public TimePeriod setStartDay(Integer day)
throws IndexOutOfBoundsException
IndexOutOfBoundsExceptionpublic TimePeriod setEndYear(Integer year)
public TimePeriod setEndMonth(Integer month)
throws IndexOutOfBoundsException
IndexOutOfBoundsException
public TimePeriod setEndDay(Integer day)
throws IndexOutOfBoundsException
IndexOutOfBoundsException
public static org.joda.time.Partial setPartialField(org.joda.time.Partial partial,
Integer value,
org.joda.time.DateTimeFieldType type)
throws IndexOutOfBoundsException
IndexOutOfBoundsException
public static TimePeriod parseString(TimePeriod timePeriod,
String periodString)
public static TimePeriod parseString(String strPeriod)
protected static org.joda.time.Partial parseSingleDate(String singleDateString)
throws IllegalArgumentException
IllegalArgumentException
protected static org.joda.time.Partial parseSingleDotDate(String singleDateString)
throws IllegalArgumentException
IllegalArgumentExceptionpublic String toString()
getFreeText() value if free text is not null.
Otherwise the concatenation of start and end is returned.
toString in class ObjectObject.toString()public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic Object clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||