IBag

Description

interface Tinman.Core.Collections.IBag<T>

Derived from

IBagConst<T>
ICollector<T>

Extended by

BagBase abstract
ISortedSet
IVector

Base interface for classes that represent a collection of elements.

Subclasses are free to implement set semantics, i.e. equal elements are stored only once.

Public / Methods

Add​All

2 overloads


public method AddAll1 → (1)

elements in : IEnumerable<T>

[not-null]
The elements to add.

returns → bool

true if the collection has changed, false if not.

Adds the given elements to this collection.


public method AddAll2 → (3)

elements in : T [ ]

[not-null]
The elements to add.

first opt : int32 = 0

[>=0]
Index of first element to add.

count opt : int32 = -1

[>=-1]
Number of elements to add. If -1 all elements from first opt to the last element are added.

returns → bool

true if the collection has changed, false if not.

Adds the given elements to this collection.

Clear


public method Clear → ()

Removes all elements from this collection.

Remove


public method Remove → (1)

element in : T

The element to remove.

returns → bool

true if the collection has changed, false if not.

Removes the given element from this collection.

Remove​All


public method RemoveAll → (1)

elements in : IEnumerable<T>

[not-null]
The elements to remove.

returns → bool

true if the collection has changed, false if not.

Removes the given elements from this collection.

Remove​Where


public method RemoveWhere → (1)

predicate in : PredicateDelegate<T>

[not-null]
The predicate to use.

returns → bool

true if the collection has changed, false if not.

Removes all elements from this collection for which the given predicate evaluates to true.

Replace​All

2 overloads


public method ReplaceAll1 → (1)

elements in : IEnumerable<T>

The elements to replace with. If null, this collection will only be cleared.

returns → bool

true if the collection has changed, false if not.

Replaces all elements in this collection with the given ones.


public method ReplaceAll2 → (3)

elements in : T [ ]

[not-null]
The elements to replace with.

first opt : int32 = 0

[>=0]
Index of first element to use.

count opt : int32 = -1

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

returns → bool

true if the collection has changed, false if not.

Replaces all elements in this collection with the given ones.