net.sf.farrago.type.runtime
Class EncodedSqlInterval.EncodedSqlIntervalDT

java.lang.Object
  extended by net.sf.farrago.type.runtime.EncodedSqlInterval
      extended by net.sf.farrago.type.runtime.EncodedSqlInterval.EncodedSqlIntervalDT
All Implemented Interfaces:
AssignableValue, DataValue
Enclosing class:
EncodedSqlInterval

public abstract static class EncodedSqlInterval.EncodedSqlIntervalDT
extends EncodedSqlInterval


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.farrago.type.runtime.EncodedSqlInterval
EncodedSqlInterval.EncodedSqlIntervalDT, EncodedSqlInterval.EncodedSqlIntervalYM
 
Field Summary
static long MS_PER_DAY
           
static long MS_PER_HOUR
           
static long MS_PER_MINUTE
           
static long MS_PER_SECOND
           
 
Fields inherited from class net.sf.farrago.type.runtime.EncodedSqlInterval
GET_END_UNIT_METHOD_NAME, GET_START_UNIT_METHOD_NAME, NF2, NF3, value
 
Fields inherited from interface net.sf.farrago.type.runtime.AssignableValue
ASSIGNMENT_METHOD_NAME
 
Constructor Summary
EncodedSqlInterval.EncodedSqlIntervalDT()
           
 
Method Summary
 void assignFrom(Object obj)
          Assigns value from an Object.
 void ceil(SqlIntervalQualifier.TimeUnit timeUnit)
          Rounds this interval value up to a unit of time.
 void floor(SqlIntervalQualifier.TimeUnit timeUnit)
          Rounds this interval value down to a unit of time.
protected  void parse(String interval)
           
 String toString()
           
 
Methods inherited from class net.sf.farrago.type.runtime.EncodedSqlInterval
assignFrom, ceil, floor, getEndUnit, getNullableData, getPrimitiveClass, getStartUnit, isNull, setNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MS_PER_SECOND

public static final long MS_PER_SECOND
See Also:
Constant Field Values

MS_PER_MINUTE

public static final long MS_PER_MINUTE
See Also:
Constant Field Values

MS_PER_HOUR

public static final long MS_PER_HOUR
See Also:
Constant Field Values

MS_PER_DAY

public static final long MS_PER_DAY
See Also:
Constant Field Values
Constructor Detail

EncodedSqlInterval.EncodedSqlIntervalDT

public EncodedSqlInterval.EncodedSqlIntervalDT()
Method Detail

assignFrom

public void assignFrom(Object obj)
Description copied from interface: AssignableValue
Assigns value from an Object.

Specified by:
assignFrom in interface AssignableValue
Overrides:
assignFrom in class EncodedSqlInterval
Parameters:
obj - value to assign, or null to set null

floor

public void floor(SqlIntervalQualifier.TimeUnit timeUnit)
Rounds this interval value down to a unit of time. All smaller units of time are zeroed also.

For example, floor(MINUTE) applied to INTERVAL '7 11:23:45' DAY TO SECOND returns INTERVAL '7 11:23:00' DAY TO SECOND.

Overrides:
floor in class EncodedSqlInterval
Parameters:
timeUnit - Time unit

ceil

public void ceil(SqlIntervalQualifier.TimeUnit timeUnit)
Rounds this interval value up to a unit of time. All smaller units of time are zeroed also.

For example, floor(MINUTE) applied to INTERVAL '7 11:23:45' DAY TO SECOND returns INTERVAL '7 11:24:00' DAY TO SECOND.

Overrides:
ceil in class EncodedSqlInterval
Parameters:
timeUnit - Time unit

parse

protected void parse(String interval)
Specified by:
parse in class EncodedSqlInterval

toString

public String toString()
Overrides:
toString in class Object