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
public class TimeInstant extends Time
Class represents a GML conform timeInstant element- Since:
- 1.0.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.n52.shetland.ogc.gml.time.Time
Time.NilReason, Time.RelativePosition, Time.TimeFormat
-
-
Constructor Summary
Constructors Constructor Description TimeInstant()default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Time o)booleanequals(Object paramObject)IndeterminateValuegetIndeterminateValue()Get indeterminate valueintgetRequestedTimeLength()Get requested time lengthTimePositiongetTimePosition()Get the time position of this time instantorg.joda.time.DateTimegetValue()Get time valueinthashCode()booleanisEmpty()Check if time is emptybooleanisIndeterminateValueEqualTo(IndeterminateValue value)Check whether this indeterminate value equals expected valuebooleanisSetIndeterminateValue()Check if indeterminate value is setbooleanisSetValue()Check if time value is setorg.joda.time.DateTimeresolveValue()Get time value, resolving indeterminate value if value is nullTimesetIndeterminateValue(IndeterminateValue indeterminateValue)Set indeterminate valuevoidsetRequestedTimeLength(int requestedTimeLength)Set requested time lengthvoidsetValue(org.joda.time.DateTime value)Set time valueStringtoString()-
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 Detail
-
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
public TimeInstant(IndeterminateValue indeterminateValue)
constructor- Parameters:
indeterminateValue- Indeterminate value
-
TimeInstant
public TimeInstant(org.joda.time.DateTime dateValue, IndeterminateValue indeterminateValue)constructor with date and indeterminateValue.- Parameters:
dateValue- date of the timeInstanteindeterminateValue- Indeterminate value
-
TimeInstant
public TimeInstant(Date date)
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 Detail
-
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
-
compareTo
public int compareTo(Time o)
-
isSetValue
public boolean isSetValue()
Check if time value is set- Returns:
- true if set
-
getIndeterminateValue
public IndeterminateValue getIndeterminateValue()
Get indeterminate value- Returns:
- Returns the indeterminateValue.
-
getTimePosition
public TimePosition getTimePosition()
Get the time position of this time instant- Returns:
- Time position
-
setIndeterminateValue
public Time setIndeterminateValue(IndeterminateValue indeterminateValue)
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
public boolean isIndeterminateValueEqualTo(IndeterminateValue value)
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- Overrides:
isEmptyin classTime- Returns:
- true, if value and indeterminateValue are NOT set
- See Also:
isSetValue(),isSetIndeterminateValue()
-
-