IBag

Description

interface Tinman.Core.Collections.IBag<T>

Derived from

IBagConst<T>
ICollector<T>

Extended by

BagBase abstract
ISet
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>

The elements to add. If null, no elements will be added.

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..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 the collection has changed, false if not.

Adds the given elements to this collection.

Clear


public method Clear → ()

returns → bool

true if the collection has changed, false if not.

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

2 overloads


public method RemoveAll1 → (1)

elements in : IEnumerable<T>

The elements to remove. If null, no elements will be removed.

returns → bool

true if the collection has changed, false if not.

Removes the given elements from this collection.


public method RemoveAll2 → (3)

elements in : T [ ]

[not-null]
The elements to remove.

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 the collection has changed, false if not.

Removes the given elements from this collection.

Remove​Where


public method RemoveWhere → (1)

predicate in : PredicateDelegate<T>

The predicate to use. If null, no elements will be removed.

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 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..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 the collection has changed, false if not.

Replaces all elements in this collection with the given ones.

Retain​All


public method RetainAll → (1)

elements in : IBagConst<T>

The elements to retain. If null, this collection will be cleared.

returns → bool

true if the collection has changed, false if not.

Removes all elements from this collection except the given keys.