Constructor and Description |
---|
Duration()
Initializes a new instance of the
Duration struct with a specified TimeSpan value and TimeUnitType. |
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 |
Clone()
Returns deep copy of the instance.
|
void |
CloneTo(Duration that)
Makes a deep copy of the instance into another instance.
|
Duration |
convert(int timeUnitType)
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.
|
static boolean |
equals(Duration obj1,
Duration obj2)
Returns a value indicating whether specified
obj1 instance is equal to the specified obj2
instance. |
boolean |
equals(Object obj)
Returns a value indicating whether this instance is equal to a specified object.
|
double |
getTimeSpan()
Gets
TimeSpan (getTimeSpan() ) instance of this Duration object. |
int |
getTimeUnit()
Gets time unit type for this object.
|
int |
hashCode()
Returns a hash code value for this object.
|
boolean |
isElapsed()
Gets a value indicating whether time unit is elapsed.
|
boolean |
isEstimated()
Gets a value indicating whether time unit is estimated.
|
static Duration |
parse(Project p,
String value)
Converts the specified string to the instance of
Duration struct. |
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 Duration()
Initializes a new instance of the Duration
struct with a specified TimeSpan value and TimeUnitType.
public Duration Clone()
Clone
in class com.aspose.ms.System.ValueType<Duration>
public void CloneTo(Duration that)
CloneTo
in class com.aspose.ms.System.ValueType<Duration>
that
- another instance.public final Duration add(Duration d)
Adds specified duration to this duration.
d
- specified Duration
to add to this instance.public final Duration add(double val)
Adds specified double value to this duration.
val
- the specified double
value to add to this instance.public Object clone()
public final Duration convert(int timeUnitType)
Converts Duration object to another duration with specified time units.
timeUnitType
- the specified time unit type.public final 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.
equals
in interface com.aspose.ms.System.IEquatable<Duration>
equals
in class Object
obj
- The object to compare with this instance.<b>True</b>
if the specified object is a Duration that has the same TimeSpan and TimeUnit values
as this instance; otherwise, <b>false</b>
.public static boolean equals(Duration obj1, Duration obj2)
obj1
instance is equal to the specified obj2
instance.obj1
- the first object to compare.obj2
- the second object to compare.obj1
instance is equal to the specified obj2
instance;
otherwise, false.public final double getTimeSpan()
Gets TimeSpan
(getTimeSpan()
) instance of this Duration object.
TimeSpan
(getTimeSpan()
) instance of this Duration object.public final int getTimeUnit()
Gets time unit type for this object.
Value: The time unit type of this Duration instance.public int hashCode()
Returns a hash code value for this object.
public final boolean isElapsed()
Gets a value indicating whether time unit is elapsed.
Value: The flag which determines whether this Duration instance is elapsed.public final boolean isEstimated()
Gets a value indicating whether time unit is estimated.
Value: The flag which determines whether this Duration instance is estimated.public static Duration parse(Project p, String value)
Converts the specified string to the instance of Duration
struct.
public static double parseTimeSpan(String value)
Parses duration string in format "PT--H--M--S--".
value
- the specified string to parse.TimeSpan
(getTimeSpan()
) struct.public final Duration subtract(Duration d)
Subtracts specified duration from this duration instance.
d
- the specified Duration
instance to subtract from this instance.public final Duration subtract(double val)
Subtracts specified double value from this duration instance.
val
- specified double
value to subtract from this instance.public final double toDouble()
Converts Duration object to double
value.