XPathDuration class final

Representation of XPath duration values (xs:duration, xs:yearMonthDuration, and xs:dayTimeDuration).

Inheritance

Constructors

XPathDuration({int years = 0, int months = 0, int days = 0, int hours = 0, int minutes = 0, int seconds = 0, int milliseconds = 0, int microseconds = 0, int? totalMonths, int? totalMicroseconds, bool isNegative = false, XPathType type = xsDuration})
Creates a new XPathDuration.
const
XPathDuration.dayTime(int totalMicroseconds)
Creates a new XPathDuration representing an xs:dayTimeDuration.
const
XPathDuration.fromDuration(Duration duration, [XPathType type = xsDayTimeDuration])
Creates a new XPathDuration from a Dart Duration object.
factory
XPathDuration.fromValues(int totalMonths, int totalMicroseconds, [XPathType type = xsDuration])
Creates a new XPathDuration from years, months, and microsecond components.
factory
XPathDuration.yearMonth(int totalMonths)
Creates a new XPathDuration representing an xs:yearMonthDuration.
const

Properties

days → int
The number of days in the duration.
no setter
effectiveBooleanValue → bool
The effective boolean value (EBV) of this item.
no setteroverride
hashCode → int
The hash code for this object.
no setteroverride
hours → int
The number of hours in the duration (0-23).
no setter
inDays → int
The duration in days.
no setter
inHours → int
The duration in hours.
no setter
inMicroseconds → int
The duration in microseconds.
no setter
inMilliseconds → int
The duration in milliseconds.
no setter
inMinutes → int
The duration in minutes.
no setter
inSeconds → int
The duration in seconds.
no setter
isDayTime → bool
Whether this duration is an xs:dayTimeDuration.
no setter
isNegative → bool
Whether the duration is negative.
no setter
isNumeric → bool
Whether this atomic value is numeric.
no setterinherited
isYearMonth → bool
Whether this duration is an xs:yearMonthDuration.
no setter
microseconds → int
The number of microseconds in the duration (0-999).
no setter
milliseconds → int
The number of milliseconds in the duration (0-999).
no setter
minutes → int
The number of minutes in the duration (0-59).
no setter
months → int
The number of months in the duration (0-11).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
seconds → int
The number of seconds in the duration (0-59).
no setter
stringValue → String
Canonical string representation of this item.
no setteroverride
totalMicroseconds → int
Total number of microseconds in this duration.
final
totalMonths → int
Total number of months in this duration.
final
type → XPathType
The XDM type of this item.
final
value → Object
The underlying Dart value representation.
no setteroverride
years → int
The number of years in the duration.
no setter

Methods

abs() → XPathDuration
Returns the absolute value of this duration.
atomize() → XPathAtomic
Atomizes this item into an XPathAtomic value.
inherited
compareTo(XPathAtomic other) → int
Compares this object to another object.
override
divideByDuration(XPathDuration other) → double
Divides this duration by another XPathDuration returning a double.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDuration() → Duration
Converts this object to a standard Dart Duration representation.
toString() → String
A string representation of this object.
override
toValue() → Duration
Converts this item to a native Dart value.
override

Operators

operator *(num factor) → XPathDuration
Multiplies this duration by a factor.
operator +(XPathDuration other) → XPathDuration
Adds another XPathDuration to this one.
operator -(XPathDuration other) → XPathDuration
Subtracts another XPathDuration from this one.
operator <(XPathDuration other) → bool
Compares if this duration is less than another.
operator <=(XPathDuration other) → bool
Compares if this duration is less than or equal to another.
operator ==(Object other) → bool
The equality operator.
override
operator >(XPathDuration other) → bool
Compares if this duration is greater than another.
operator >=(XPathDuration other) → bool
Compares if this duration is greater than or equal to another.
operator unary-() → XPathDuration
Negates this duration.
operator ~/(int quotient) → XPathDuration
Divides this duration by an integer quotient.

Static Methods

tryParse(String value, [XPathType type = xsDuration]) → XPathDuration?
Attempts to parse a string representation of a duration.
tryParseDayTime(String value) → XPathDuration?
Attempts to parse a string representation of a dayTimeDuration.
tryParseYearMonth(String value) → XPathDuration?
Attempts to parse a string representation of a yearMonthDuration.