Compounds<T> class

A pseudo-list of compounds.

A pseudo-list "containing" all the compounds (permutations of unspecified length) of objects taken from the list elements.

Example

final com = Compounds(letters("abcd"));
print("There are ${com.length} subsets of the objects");
print("in ${com.items}.");
print("The first subset is ${com[0]}.");
Inheritance

Constructors

Compounds(List<T> items)

Properties

hashCode int
The hash code for this object.
no setterinherited
items List<T>
The list from which the objects are selected
no setteroverride
iterable Iterable
An Iterable object that "contains" all the arrangements.
no setterinherited
length BigInt
The number of arrangements "contained" in this pseudo-list.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call([Object? fromTo, Object? to]) Iterable<List<T>>
inherited
contains(List<T> x) bool
Returns whether x is in the pseudo-list.
override
indexOf(List<T> compound, [BigInt? start]) BigInt
Returns the index of subset in the list of arranged subsets.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
range(Object fromTo, [Object? to]) Iterable<List<T>>
Returns a range of arrangements.
inherited
sample(int n, {int? seed, bool withReplacement = false}) Iterable
Generates a random sample of arrangements from this pseudo-list.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](Object k) List<T>
The kth arrangement.
override