com.plumtree.remote.prc
Class TimeInterval

java.lang.Object
  extended bycom.plumtree.remote.prc.TimeInterval

public class TimeInterval
extends java.lang.Object

A type used to represents the numeric value and the unit component of a time interval. See IDocumentManager.setBrokenLinkDeletionTime(int, com.plumtree.remote.prc.TimeInterval) and com.plumtree.remote.prc.IDocumentManager#setRefreshRate(int, com.plumtree.remote.prc.TimeInterval).


Field Summary
static TimeInterval INFINITE
          A static field to represent an infinite time interval.
 
Constructor Summary
TimeInterval(int value, TimeIntervalUnit unit)
          Creates a TimeInterval with the specified value and unit.
 
Method Summary
 TimeIntervalUnit getUnit()
          Returns the unit of the interval.
 int getValue()
          Returns the value of the interval.
 void setUnit(TimeIntervalUnit unit)
          Sets the unit of the interval.
 void setValue(int value)
          Sets the value of the interval.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFINITE

public static final TimeInterval INFINITE
A static field to represent an infinite time interval. Default value is Integer.MAX_VALUE and default unit is TimeIntervalUnit.UNSET.
Neither the value nor the unit component of this field cannot be modified, otherwise an IllegalStateException will be thrown.

Constructor Detail

TimeInterval

public TimeInterval(int value,
                    TimeIntervalUnit unit)
Creates a TimeInterval with the specified value and unit.

Parameters:
value - numeric component of a time interval.
unit - unit component of the time interval; cannot be TimeIntervalUnit.UNSET.
Throws:
java.lang.IllegalArgumentException - if TimeIntervalUnit.UNSET is set to be the unit.
Method Detail

getUnit

public TimeIntervalUnit getUnit()
Returns the unit of the interval. For TimeInterval.INFINITE, TimeIntervalUnit.UNSET will be returned.

Returns:
the unit of the interval.

setUnit

public void setUnit(TimeIntervalUnit unit)
Sets the unit of the interval.

Parameters:
unit - unit of the time interval.
Throws:
java.lang.IllegalStateException - if the current instance is a TimeInterval.INFINITE.

getValue

public int getValue()
Returns the value of the interval. For TimeInterval.INFINITE, Integer.MAX_VALUE will be returned.

Returns:
the value of the interval.

setValue

public void setValue(int value)
Sets the value of the interval.

Parameters:
value - the numeric value of the time interval.
Throws:
java.lang.IllegalStateException - if the current instance is a TimeInterval.INFINITE.


For additional information on the IDK, including tutorials, blogs, code samples and more,see the AquaLogic User Interaction Developer Center on BEA dev2dev.

Copyright ©2007 BEA Systems, Inc. All Rights Reserved.