|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.gantt.IlvDuration
public class IlvDuration
IlvDuration represents a relative time period, with
millisecond precision. IlvDuration is an immutable class
with value semantics.
| Field Summary | |
|---|---|
static IlvDuration |
ONE_DAY
A duration of 1 day. |
static long |
ONE_DAY_MILLIS
The number of milliseconds in 1 day. |
static IlvDuration |
ONE_HOUR
A duration of 1 hour. |
static long |
ONE_HOUR_MILLIS
The number of milliseconds in 1 hour. |
static IlvDuration |
ONE_MINUTE
A duration of 1 minute. |
static long |
ONE_MINUTE_MILLIS
The number of milliseconds in 1 minute. |
static IlvDuration |
ONE_SECOND
A duration of 1 second. |
static long |
ONE_SECOND_MILLIS
The number of milliseconds in 1 second. |
static IlvDuration |
ONE_WEEK
A duration of 1 week. |
static long |
ONE_WEEK_MILLIS
The number of milliseconds in 1 week. |
| Constructor Summary | |
|---|---|
IlvDuration(long millis)
Creates an IlvDuration that represents the specified
number of milliseconds. |
|
| Method Summary | |
|---|---|
Date |
add(Date t)
Returns a new Date that is the sum of the specified time
and this duration. |
IlvDuration |
add(IlvDuration delta)
Returns a new IlvDuration that is the sum of this
duration and the specified duration. |
int |
compareTo(IlvDuration anotherDuration)
Returns the result of comparing this duration to the specified duration. |
int |
compareTo(Object o)
Returns the result of comparing this duration to another object. |
IlvDuration |
divide(double divisor)
Returns a new IlvDuration that is the result of dividing
this duration by the specified amount. |
IlvDuration |
divide(int divisor)
Returns a new IlvDuration that is the result of dividing
this duration by the specified amount. |
boolean |
equals(Object obj)
Returns whether an object is logically equal to this duration. |
long |
getMillis()
Returns the number of milliseconds that this duration represents. |
int |
hashCode()
Returns a hashcode for this duration. |
IlvDuration |
multiply(double multiplier)
Returns a new IlvDuration that is the result of
multiplying this duration by the specified amount. |
IlvDuration |
multiply(int multiplier)
Returns a new IlvDuration that is the result of
multiplying this duration by the specified amount. |
IlvDuration |
subtract(IlvDuration delta)
Returns a new IlvDuration that is the difference between
this duration and the specified duration. |
String |
toString()
Returns a string representation of this duration. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long ONE_SECOND_MILLIS
public static final long ONE_MINUTE_MILLIS
public static final long ONE_HOUR_MILLIS
public static final long ONE_DAY_MILLIS
public static final long ONE_WEEK_MILLIS
public static final IlvDuration ONE_SECOND
public static final IlvDuration ONE_MINUTE
public static final IlvDuration ONE_HOUR
public static final IlvDuration ONE_DAY
public static final IlvDuration ONE_WEEK
| Constructor Detail |
|---|
public IlvDuration(long millis)
IlvDuration that represents the specified
number of milliseconds.
millis - The number of milliseconds.| Method Detail |
|---|
public long getMillis()
public Date add(Date t)
Date that is the sum of the specified time
and this duration.
t - The time to add to this duration.public IlvDuration add(IlvDuration delta)
IlvDuration that is the sum of this
duration and the specified duration.
delta - The duration to add to this duration.public IlvDuration subtract(IlvDuration delta)
IlvDuration that is the difference between
this duration and the specified duration.
delta - The duration to subtract from this duration.public IlvDuration multiply(int multiplier)
IlvDuration that is the result of
multiplying this duration by the specified amount.
multiplier - The amount to multiply this duration by.public IlvDuration multiply(double multiplier)
IlvDuration that is the result of
multiplying this duration by the specified amount.
multiplier - The amount to multiply this duration by.public IlvDuration divide(int divisor)
IlvDuration that is the result of dividing
this duration by the specified amount.
divisor - The amount to divide this duration by.public IlvDuration divide(double divisor)
IlvDuration that is the result of dividing
this duration by the specified amount.
divisor - The amount to divide this duration by.public boolean equals(Object obj)
true if and only if the argument is
an IlvDuration object that represents the same length of
time as this duration.
equals in class Objectobj - The object to compare with.
true if the objects are the same;
false otherwise.public int compareTo(IlvDuration anotherDuration)
anotherDuration - The duration to be compared to this one.
public int compareTo(Object o)
IlvDuration, this function behaves like
compareTo(IlvDuration). Otherwise, it throws a
ClassCastException because IlvDuration
objects are comparable only to other IlvDuration objects.
compareTo in interface Comparableo - The object to be compared.
ClassCastException - if the argument is not an
IlvDuration.public int hashCode()
long value returned
by the getMillis() method. That is, the hash code is the value
of the expression:
(int)(this.getMillis()^(this.getMillis() >>> 32))
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||