com.hp.ucmdb.api.discovery.types
Interface TimeInterval

All Superinterfaces:
java.io.Serializable

public interface TimeInterval
extends java.io.Serializable

A continuous time interval.


Nested Class Summary
static class TimeInterval.Unit
          Time units.
 
Method Summary
 double getInterval()
          Returns the duration of this TimeInterval.
 TimeInterval.Unit getUnit()
          Returns the time unit used by this TimeInterval object.
 TimeInterval ofUnits(TimeInterval.Unit unit)
          Sets the time unit used by this TimeInterval object.
 void setInterval(double interval)
          Sets the duration of this TimeInterval.
 void setUnits(TimeInterval.Unit unit)
          Sets the time unit used by this TimeInterval object.
 TimeInterval withInterval(double interval)
          Sets the duration of this TimeInterval.
 

Method Detail

setUnits

void setUnits(TimeInterval.Unit unit)
Sets the time unit used by this TimeInterval object. Default is DAY.

Parameters:
unit - the time unit.

setInterval

void setInterval(double interval)
Sets the duration of this TimeInterval. For example, to set a duration of five hours:
         setUnits(Unit.HOUR);
         setInterval(5);
         

Parameters:
interval - the duration.

ofUnits

TimeInterval ofUnits(TimeInterval.Unit unit)
Sets the time unit used by this TimeInterval object. Default value is DAY.

Parameters:
unit - the time unit.
Returns:
this object with the change (for chaining).

withInterval

TimeInterval withInterval(double interval)
Sets the duration of this TimeInterval.

Parameters:
interval - the interval.
Returns:
this object with the change (for chaining).

getUnit

TimeInterval.Unit getUnit()
Returns the time unit used by this TimeInterval object.

Returns:
the time unit used by this TimeInterval object.

getInterval

double getInterval()
Returns the duration of this TimeInterval.

Returns:
interval the duration of this TimeInterval.


Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.