Holger's Java API

## com.antelmann.calendar
Class HourFormat

    java.lang.Object
      java.text.Format
          com.antelmann.calendar.HourFormat

All Implemented Interfaces:
  Serializable, Cloneable

    public class HourFormat

extends Format

a special format to convert between an long and its representation in the format h:mm:ss

Since:
  01/13/09
Author:
  Holger Antelmann
See Also:
  `Stopwatch`, Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class java.text.Format
`Format.Field`

Constructor Summary
`HourFormat()`
`HourFormat(boolean useLongDisplayFormat)` if the long display format is used, parsing is currently not supported
`HourFormat(String decimalFormat)` uses a decimal hour format

Method Summary
`static long` `decimalHoursToTime(double hours)`
`StringBuffer` `format(Object value, StringBuffer toAppendTo, FieldPosition fieldPosition)`
`boolean` `isUseLongDisplayFormat()`
`Long` `parseObject(String source, ParsePosition pos)`
`static double` `toDecimalHours(long time)`

Methods inherited from class java.text.Format
`clone, format, formatToCharacterIterator, parseObject`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### HourFormat

    public HourFormat(String decimalFormat)

  uses a decimal hour format

  See Also:
    `toDecimalHours(long)`, `DecimalFormat`

### HourFormat

    public HourFormat()

### HourFormat

    public HourFormat(boolean useLongDisplayFormat)

  if the long display format is used, parsing is currently not supported

Method Detail

### isUseLongDisplayFormat

    public boolean isUseLongDisplayFormat()

### format

    public StringBuffer format(Object value,
                               StringBuffer toAppendTo,
                               FieldPosition fieldPosition)

  Specified by:
    `format` in class `Format`

### parseObject

    public Long parseObject(String source,
                            ParsePosition pos)

  Specified by:
    `parseObject` in class `Format`

### decimalHoursToTime

    public static long decimalHoursToTime(double hours)

### toDecimalHours

    public static double toDecimalHours(long time)

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads