public class Duration extends Object
Represents duration in a project.
Modifier and Type | Method and Description |
---|---|
Duration |
add(double val)
Adds specified double value to this duration.
|
Duration |
add(Duration d)
Adds specified duration to this duration.
|
Object |
clone()
Creates and returns a copy of this Duration.
|
Duration |
convert(int timeUnit)
Converts Duration object to another duration with specified time units.
|
boolean |
equals(Duration other)
Returns a value indicating whether this instance is equal to a specified object.
|
boolean |
equals(Object obj)
Returns a value indicating whether this instance is equal to a specified object.
|
double |
getTimeSpan()
Returns time span in milliseconds of this Duration object.
|
int |
getTimeUnit()
Returns time unit type of this Duration instance.
|
int |
hashCode()
Returns a hash code value for this object.
|
boolean |
isEstimated()
Returns true if time unit is estimated; otherwise, false.
|
static Duration |
parse(Project p,
String value)
Converts the specified string to the instance of
Duration class. |
static double |
parseTimeSpan(String value)
Parses duration string in format "PT--H--M--S--".
|
Duration |
subtract(double val)
Subtracts specified double value from this duration instance.
|
Duration |
subtract(Duration d)
Subtracts specified duration from this duration instance.
|
double |
toDouble()
Converts Duration object to
double value. |
String |
toString()
Returns a string representation of this instance.
|
public double getTimeSpan()
public int getTimeUnit()
Returns time unit type of this Duration instance.
public boolean isEstimated()
Returns true if time unit is estimated; otherwise, false.
public static Duration parse(Project p, String value)
Converts the specified string to the instance of Duration
class.
p
- the specified instance of Project
class to convert duration for.value
- the specified string to convert.Duration
class.public static double parseTimeSpan(String value)
Parses duration string in format "PT--H--M--S--".
value
- the specified string to parse.TimeSpan
struct.public double toDouble()
Converts Duration object to double
value.
public Duration convert(int timeUnit)
Converts Duration object to another duration with specified time units.
timeUnit
- the specified time unit type.public Duration add(Duration d)
Adds specified duration to this duration.
d
- specified Duration
to add to this instance.public Duration add(double val)
Adds specified double value to this duration.
val
- the specified double
value to add to this instance.public Duration subtract(Duration d)
Subtracts specified duration from this duration instance.
d
- the specified Duration
instance to subtract from this instance.public Duration subtract(double val)
Subtracts specified double value from this duration instance.
val
- specified double
value to subtract from this instance.public String toString()
Returns a string representation of this instance.
public boolean equals(Duration other)
Returns a value indicating whether this instance is equal to a specified object.
other
- The object to compare with this instance.<b>True</b>
if other Duration instance has the same TimeSpan and TimeUnit values as this instance; otherwise, <b>false</b>
.public boolean equals(Object obj)
Returns a value indicating whether this instance is equal to a specified object.
public int hashCode()
Returns a hash code value for this object.
Copyright (c) 2008-2015 Aspose Pty Ltd. All Rights Reserved.