XPathSequence class abstract
Base class for all sequences in the XDM 3.1 data model.
Constructors
-
XPathSequence([Iterable<
XPathItem> ? items]) -
Creates a sequence from an iterable of items.
factory
-
XPathSequence.from(Iterable<
Object?> items) -
Creates a sequence from an iterable, flattening any nested sequences.
factory
- XPathSequence.single(XPathItem item)
-
Creates a sequence with a single
item.constfactory
Properties
- ebv → bool
-
The effective boolean value (EBV) per W3C XPath 3.1 §2.4.3.
no setter
- effectiveBooleanValue → bool
-
The effective boolean value (EBV) of this sequence.
no setter
- first → XPathItem
-
The first element.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
XPathItem> -
A new
Iteratorthat allows iterating the elements of thisIterable.no setterinherited - last → XPathItem
-
The last element.
no setterinherited
- length → int
-
The number of elements in this Iterable.
no setterinherited
-
nodes
→ Iterable<
XmlNode> -
The XML nodes contained in this sequence.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → XPathItem
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
- singleOrNull → XPathItem?
-
The single item if this sequence has length 1, or
nullotherwise.no setter
Methods
-
any(
bool test(XPathItem element)) → bool -
Checks whether any element of this iterable satisfies
test.inherited -
atomize(
) → Iterable< XPathAtomic> - Atomizes this sequence into a list of atomic items.
-
cast<
R> () → Iterable< R> -
A view of this iterable as an iterable of
Rinstances.inherited -
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element.inherited -
elementAt(
int index) → XPathItem -
Returns the
indexth element.inherited -
every(
bool test(XPathItem element)) → bool -
Checks whether every element of this iterable satisfies
test.inherited -
expand<
T> (Iterable< T> toElements(XPathItem element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
firstWhere(
bool test(XPathItem element), {XPathItem orElse()?}) → XPathItem -
The first element that satisfies the given predicate
test.inherited -
fold<
T> (T initialValue, T combine(T previousValue, XPathItem element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< XPathItem> other) → Iterable<XPathItem> -
Creates the lazy concatenation of this iterable and
other.inherited -
forEach(
void action(XPathItem element)) → void -
Invokes
actionon each element of this iterable in iteration order.inherited -
hasCardinality(
XPathCardinality cardinality) → bool -
Whether this sequence satisfies
cardinality. -
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(
bool test(XPathItem element), {XPathItem orElse()?}) → XPathItem -
The last element that satisfies the given predicate
test.inherited -
map<
T> (T toElement(XPathItem e)) → Iterable< T> -
The current elements of this iterable modified by
toElement.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reduce(
XPathItem combine(XPathItem value, XPathItem element)) → XPathItem -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
singleWhere(
bool test(XPathItem element), {XPathItem orElse()?}) → XPathItem -
The single element that satisfies
test.inherited -
skip(
int count) → Iterable< XPathItem> -
Creates an Iterable that provides all but the first
countelements.inherited -
skipWhile(
bool test(XPathItem element)) → Iterable< XPathItem> -
Creates an
Iterablethat skips leading elements whiletestis satisfied.inherited -
take(
int count) → Iterable< XPathItem> -
Creates a lazy iterable of the
countfirst elements of this iterable.inherited -
takeWhile(
bool test(XPathItem element)) → Iterable< XPathItem> -
Creates a lazy iterable of the leading elements satisfying
test.inherited -
toList(
{bool growable = true}) → List< XPathItem> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< XPathItem> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
Returns a string representation of (some of) the elements of
this.inherited -
toValue(
) → Object? - Converts this sequence to a native Dart value:
-
where(
bool test(XPathItem element)) → Iterable< XPathItem> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test.inherited -
whereType<
T> () → Iterable< R> -
Creates a new lazy Iterable with all elements that have type
T.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
fromObject(
Object? value) → XPathSequence - Converts any Dart object or collection into an XPathSequence.
-
range(
XPathInteger start, XPathInteger stop) → XPathSequence -
Creates a sequence representing an integer range
starttostop. -
toItem(
Object obj) → XPathItem - Converts an arbitrary object into a valid XPathItem.
Constants
- empty → const _XPathEmptySequence
- Canonical empty sequence.
- emptyArray → const _XPathSingleSequence
- Singleton empty array sequence.
- emptyMap → const _XPathSingleSequence
- Singleton empty map sequence.
- falseSequence → const _XPathSingleSequence
- Singleton false sequence.
- trueSequence → const _XPathSingleSequence
- Singleton true sequence.