IBagConst

Description

interface Tinman.Core.Collections.IBagConst<T>

Derived from

IEnumerable<T>

Extended by

BagConstBase abstract
IBag
ISetConst
IVectorConst

Base interface for classes that represent a read-only collection of elements.

Subclasses are free to implement set semantics, i.e. equal elements are stored only once. In that case, they should implement ISetConst.

Public / Methods

Contains


[Pure]
public method Contains → (1)

element in : T

The element.

returns → bool

true if element in is contained in this collection, false if not.

Returns if this collection contains the given element.

Contains​All

2 overloads


public method ContainsAll1 → (1)

elements in : IEnumerable<T>

The elements. If null, the method returns true.

returns → bool

true if all elements are contained in this collection, false if not.

Returns if this collection contains all the given elements.

This method will return false iff there is at least one element in elements in for which Contains returns false.


public method ContainsAll2 → (3)

elements in : T [ ]

[not-null]
The elements.

first opt : int32 = 0

[0..elements.Length]
Index of first element to use.

count opt : int32 = -1

[-1..elements.Length-first]
Number of elements to use. If -1 all elements from first opt to the last element are used.

returns → bool

true if all elements are contained in this collection, false if not.

Returns if this collection contains all the given elements.

This method will return false iff there is at least one element in elements in for which Contains returns false.

Contains​Many

2 overloads


public method ContainsMany1 → (1)

elements in : IEnumerable<T>

The elements. If null, the method returns a positive value.

returns → int32

< 0 : if no elements are contained in this collection,
= 0 : if some elements are contained,
> 0 : if all elements are contained.

Returns if this collection contains none, some or all of the given elements.

This method will return false iff there is at least one element in elements in for which Contains returns false.


public method ContainsMany2 → (3)

elements in : T [ ]

[not-null]
The elements.

first opt : int32 = 0

[0..elements.Length]
Index of first element to use.

count opt : int32 = -1

[-1..elements.Length-first]
Number of elements to use. If -1 all elements from first opt to the last element are used.

returns → int32

< 0 : if no elements are contained in this collection,
= 0 : if some elements are contained,
> 0 : if all elements are contained.

Returns if this collection contains none, some or all of the given elements.

This method will return false iff there is at least one element in elements in for which Contains returns false.

First


[Pure]
public method First → ()

returns → T

The first enumerated value.

Returns the first enumerated value.

If the enumeration is empty, the default element type value is returned.

Last


[Pure]
public method Last → ()

returns → T

The last enumerated value.

Returns the last enumerated value.

If the enumeration is empty, the default element type value is returned.

To​Array

2 overloads


[Pure]
public method ToArray1 → ()

returns → T [ ]

The array of elements.

Returns the elements of this enumerable object as a fresh array.


[Pure]
public method ToArray2 → (1)

order in : CompareDelegate<T>

[not-null]
The sort order.

returns → T [ ]

The array of elements.

Returns the elements of this enumerable object as a fresh array in the given order in.

To​Array​Copy


public method ToArrayCopy → (2)

array in : T [ ]

[not-null]
The output array.

offset opt : int32 = 0

[0..array.Length]
Offset into array in.

returns → T [ ]

The filled array in.

Returns the elements of this collection as an array.

The elements in this collection will be copied into the given array, starting at the array index specified by offset opt.

Public / Attributes

Count


public attribute Count → (get)

value : int32

[>=0]
The number of elements.

The number of elements in this collection.

Method​Comparison


[Constant]
public attribute MethodComparison → (get)

value : CompareDelegate<T>

The comparison order that is used by this collection or null iff this collection is not sorted and thus does not have a total order.

Returns the method that imposes a total order on the set of possible collection values.

Implementations are not required to actually use the exact same delegate returned by this property. The delegate is only required to be consistent with the comparison order used by the implementation.

Method​Equality


[Constant]
public attribute MethodEquality → (get)

value : EqualsDelegate<T>

[not-null]
The equality predicate that is used by this collection.

Returns the method for determining whether two values are equal.

Implementations are not required to actually use the exact same delegate returned by this property. The delegate is only required to be consistent with the equality predicate used by the implementation.

Method​Hash​Code


[Constant]
public attribute MethodHashCode → (get)

value : HashCodeDelegate<T>

The hashcode method for values that is used by this collection or null iff this collection does not use value hashes.

Returns the method for computing hashes for collection values.

Implementations are not required to actually use the exact same delegate returned by this property. The delegate is only required to be consistent with the hashing method used by the implementation.