ca.infoway.messagebuilder.domainvalue.basic
Class DefaultTimeUnit

Package class diagram package DefaultTimeUnit
java.lang.Object
  extended by ca.infoway.messagebuilder.lang.Enum
      extended by ca.infoway.messagebuilder.lang.EnumPattern
          extended by ca.infoway.messagebuilder.domainvalue.basic.DefaultTimeUnit
All Implemented Interfaces:
Code, DateConverter, UnitsOfMeasureCaseSensitive, x_TimeUnitsOfMeasure, Serializable, Comparable

public class DefaultTimeUnit
extends EnumPattern
implements DateConverter, x_TimeUnitsOfMeasure

An enum to handle basic time units.

Author:
Intelliware Development
See Also:
Serialized Form

Field Summary
static DefaultTimeUnit DAY
           
static DefaultTimeUnit HOUR
           
static DefaultTimeUnit MINUTE
           
static DefaultTimeUnit MONTH
           
static DefaultTimeUnit SECOND
           
static DefaultTimeUnit WEEK
           
static DefaultTimeUnit YEAR
           
 
Fields inherited from class ca.infoway.messagebuilder.lang.Enum
INNER_CLASS_SEPARATOR_CHAR, iToString, PACKAGE_SEPARATOR_CHAR
 
Method Summary
 String getCodeSystem()
          Returns the code system for uniform unit of measure.
 String getCodeValue()
          Returns the code value.
static boolean isDayBased(UnitsOfMeasureCaseSensitive units)
           
static DefaultTimeUnit lookup(String unitCodeValue)
          Returns the DefaultTimeUnit that is applicable for the given unit code value.
 long toMilliseconds(BigDecimal quantity)
          Converts the given BigDecimal into milliseconds.
 long toMilliseconds(int value)
          Converts the given value into milliseconds.
 
Methods inherited from class ca.infoway.messagebuilder.lang.EnumPattern
getEnumConstants, isEnum, name, toString, valueOf, values
 
Methods inherited from class ca.infoway.messagebuilder.lang.Enum
compareTo, equals, getEnum, getEnumClass, getEnumList, getEnumMap, getName, getShortClassName, getShortClassName, hashCode, iterator, readResolve
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

YEAR

public static final DefaultTimeUnit YEAR

MONTH

public static final DefaultTimeUnit MONTH

WEEK

public static final DefaultTimeUnit WEEK

DAY

public static final DefaultTimeUnit DAY

HOUR

public static final DefaultTimeUnit HOUR

MINUTE

public static final DefaultTimeUnit MINUTE

SECOND

public static final DefaultTimeUnit SECOND
Method Detail

getCodeSystem

public String getCodeSystem()

Returns the code system for uniform unit of measure.

Specified by:
getCodeSystem in interface Code
Returns:
the code system for uniform unit of measure.

getCodeValue

public String getCodeValue()

Returns the code value.

Specified by:
getCodeValue in interface Code
Returns:
the code value

toMilliseconds

public long toMilliseconds(int value)

Converts the given value into milliseconds.

Specified by:
toMilliseconds in interface DateConverter
Parameters:
value - the value to convert
Returns:
the given value in milliseconds.

toMilliseconds

public long toMilliseconds(BigDecimal quantity)

Converts the given BigDecimal into milliseconds.

Parameters:
quantity - the BigDecimal to convert.
Returns:
the given value in milliseconds.

isDayBased

public static boolean isDayBased(UnitsOfMeasureCaseSensitive units)

lookup

public static DefaultTimeUnit lookup(String unitCodeValue)

Returns the DefaultTimeUnit that is applicable for the given unit code value.

Parameters:
unitCodeValue - the unit code value
Returns:
the DefaultTimeUnit that is applicable for the given unit code value


Copyright © 2013. All Rights Reserved.