Package org.n52.shetland.ogc.gml.time
Class TimeInstant
java.lang.Object
org.n52.shetland.ogc.gml.time.Time
org.n52.shetland.ogc.gml.time.TimeInstant
- All Implemented Interfaces:
Serializable,Comparable<Time>
- Direct Known Subclasses:
InspireDateOfCreation,InspireDateOfLastRevision,InspireDateOfPublication
Class represents a GML conform timeInstant element
- Since:
- 1.0.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.n52.shetland.ogc.gml.time.Time
Time.NilReason, Time.RelativePosition, Time.TimeFormat -
Constructor Summary
ConstructorsConstructorDescriptiondefault constructorTimeInstant(Date date) Constructor using Java Dates, setting unknown indeterminate values if nullTimeInstant(org.joda.time.DateTime dateTime) constructorTimeInstant(org.joda.time.DateTime value, int requestedTimeLength) TimeInstant(org.joda.time.DateTime dateValue, IndeterminateValue indeterminateValue) constructor with date and indeterminateValue.TimeInstant(org.joda.time.Instant instant) Creates a newTimeInstant.TimeInstant(IndeterminateValue indeterminateValue) constructor -
Method Summary
Modifier and TypeMethodDescriptionintbooleanGet indeterminate valueintGet requested time lengthGet the time position of this time instantorg.joda.time.DateTimegetValue()Get time valueinthashCode()booleanisEmpty()Check if time is emptybooleanCheck whether this indeterminate value equals expected valuebooleanCheck if indeterminate value is setbooleanCheck if time value is setorg.joda.time.DateTimeGet time value, resolving indeterminate value if value is nullsetIndeterminateValue(IndeterminateValue indeterminateValue) Set indeterminate valuevoidsetRequestedTimeLength(int requestedTimeLength) Set requested time lengthvoidsetValue(org.joda.time.DateTime value) Set time valuetoString()Methods inherited from class org.n52.shetland.ogc.gml.time.Time
getGmlId, getNilReason, getReference, getTimeFormat, isNilReasonEqualTo, isReferenced, isSetGmlId, isSetNilReason, isSetReference, isSetTimeFormat, resolveDateTime, setGmlId, setNilReason, setReference, setTimeFormat
-
Constructor Details
-
TimeInstant
public TimeInstant()default constructor -
TimeInstant
public TimeInstant(org.joda.time.DateTime dateTime) constructor- Parameters:
dateTime- Time position of this time instant
-
TimeInstant
public TimeInstant(org.joda.time.Instant instant) Creates a newTimeInstant.- Parameters:
instant- the instant
-
TimeInstant
constructor- Parameters:
indeterminateValue- Indeterminate value
-
TimeInstant
constructor with date and indeterminateValue.- Parameters:
dateValue- date of the timeInstanteindeterminateValue- Indeterminate value
-
TimeInstant
Constructor using Java Dates, setting unknown indeterminate values if null- Parameters:
date- Value date
-
TimeInstant
public TimeInstant(org.joda.time.DateTime value, int requestedTimeLength)
-
-
Method Details
-
getValue
public org.joda.time.DateTime getValue()Get time value- Returns:
- Returns the value.
-
setValue
public void setValue(org.joda.time.DateTime value) Set time value- Parameters:
value- The value to set.
-
resolveValue
public org.joda.time.DateTime resolveValue()Get time value, resolving indeterminate value if value is null- Returns:
- Returns the resolved value.
-
setRequestedTimeLength
public void setRequestedTimeLength(int requestedTimeLength) Set requested time length- Parameters:
requestedTimeLength- the requestedTimeLength to set
-
getRequestedTimeLength
public int getRequestedTimeLength()Get requested time length- Returns:
- the requestedTimeLength
-
toString
-
compareTo
-
equals
-
hashCode
public int hashCode() -
isSetValue
public boolean isSetValue()Check if time value is set- Returns:
- true if set
-
getIndeterminateValue
Get indeterminate value- Returns:
- Returns the indeterminateValue.
-
getTimePosition
Get the time position of this time instant- Returns:
- Time position
-
setIndeterminateValue
Set indeterminate value- Parameters:
indeterminateValue- The indeterminateValue to set.- Returns:
- this
-
isSetIndeterminateValue
public boolean isSetIndeterminateValue()Check if indeterminate value is set- Returns:
- true if set
-
isIndeterminateValueEqualTo
Check whether this indeterminate value equals expected value- Parameters:
value- Expected value- Returns:
true, if this indeterminate value equals expected value
-
isEmpty
public boolean isEmpty()Description copied from class:TimeCheck if time is empty
-