one.world.binding
Class Duration

java.lang.Object
  |
  +--one.world.binding.Duration

public final class Duration
extends Object

The definition of duration constants. Durations of leases are expresed in milliseconds, consistent with Java's use of milliseconds, with the exception of FOREVER, which has the maximum long value and denotes an infinite duration, and ANY, which has -1 as its value and denotes any duration. As a result, all non-negative long numbers, besides the maximum value, can be used as valid, specific durations.

Version:
$Revision: 1.6 $

Field Summary
static long ANY
          Any duration.
static long DAY
          A day.
static long FOREVER
          Forever.
static long HOUR
          An hour.
static long MINUTE
          A minute.
static long SECOND
          A second.
static long YEAR
          A year.
 
Method Summary
static String format(long millis)
          Format the specified duration in milliseconds as years, days, hours, minutes, and seconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECOND

public static final long SECOND
A second.

MINUTE

public static final long MINUTE
A minute.

HOUR

public static final long HOUR
An hour.

DAY

public static final long DAY
A day.

YEAR

public static final long YEAR
A year.

FOREVER

public static final long FOREVER
Forever.

ANY

public static final long ANY
Any duration.
Method Detail

format

public static String format(long millis)
Format the specified duration in milliseconds as years, days, hours, minutes, and seconds.
Parameters:
millis - The duration in milliseconds.
Returns:
The string representation in years, days, hours, minutes, and seconds.


(C) Copyright 2001 UW CSE