An object containing an ordered sequence of elements.
This class is the object equivalent of List.
List
The function used to compute the default value for a listing element given its index.
The number of elements in this listing.
Tells if this listing is empty, that is, has zero elements.
Tells if this listing has no duplicate elements.
isUnique
Facts:
new Listing { 1; 2; 3 }.isDistinct !new Listing { 1; 2; 1 }.isDistinct
Removes duplicate elements from this listing, preserving the first occurrence.
unique
new Listing { 1; 2; 3 }.distinct == new Listing { 1; 2; 3 } new Listing { 1; 2; 1 }.distinct == new Listing { 1; 2 }
Returns the class of this.
this
Returns a string representation of this.
This method is used to convert the values of string interpolation expressions to strings.
Returns this |> transform if this is non-null, and null otherwise.
this |> transform
null
This method is the complement of the ?? operator and the equivalent of an Option type's map and flatMap methods.
??
Option
map
flatMap
Tells if this listing has no elements that are duplicates after applying selector.
selector
isUniqueBy
new Listing { "a"; "ab"; "abc" }.isDistinctBy((it) -> it.length) !new Listing { "a"; "ab"; "c" }.isDistinctBy((it) -> it.length)
Removes elements that are duplicates after applying selector from this listing, preserving the first occurrence.
uniqueBy
new Listing { "a"; "ab"; "abc" }.distinctBy((it) -> it.length) == new Listing { "a"; "ab"; "abc" } new Listing { "a"; "ab"; "c" }.distinctBy((it) -> it.length) == new Listing { "a"; "ab" }
Folds this listing in iteration order using operator, starting with initial.
operator
initial
The first parameter of operator is the zero-based index of the current element.
Converts the elements of this listing to strings and concatenates them inserting separator between elements.
separator
Converts this listing to a List.
Converts this listing to a Set.
Set
An object containing an ordered sequence of elements.