Class GuardedCollectionValue<T>

A read-only wrapper for an ICollectionValue<T> This is mainly interesting as a base of other guard classes

Implements

IEnumerable<T>, System.Collections.IEnumerable, System.IFormattable, ICollectionValue<T>, IShowable

Bases

object, GuardedEnumerable<T>

Base of

GuardedCollection<T>, GuardedDictionary<K,V>, GuardedDirectedCollectionValue<T>, GuardedIndexedSorted<T>, GuardedList<T>, GuardedQueue<T>, GuardedSequenced<T>, GuardedSorted<T>, GuardedSortedDictionary<K,V>

Event overview

CollectionChanged ,
CollectionCleared ,
ItemInserted ,
ItemRemovedAt ,
ItemsAdded ,
ItemsRemoved

Property overview

ActiveEvents ,
Count ,
CountSpeed ,
IsEmpty ,
ListenableEvents

Constructor overview

GuardedCollectionValue<T>(ICollectionValue<T> collectionvalue)

Method overview

All(Fun<T,bool> filter) ,
Apply(Act<T> a) ,
Choose() ,
CopyTo(T[] a, int i) ,
Equals(object obj), Inherited from object ,
Exists(Fun<T,bool> filter) ,
Filter(Fun<T,bool> filter) ,
Finalize(), Inherited from object ,
Find(Fun<T,bool> filter, out T item) ,
GetEnumerator(), Inherited from GuardedEnumerable<T> ,
GetHashCode(), Inherited from object ,
GetType(), Inherited from object ,
MemberwiseClone(), Inherited from object ,
Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider) ,
ToArray() ,
ToString(string format, System.IFormatProvider formatProvider) ,
ToString(), Inherited from object

Event details

CollectionChangedHandler<T> CollectionChanged The change event. Will be raised for every change operation on the collection.
CollectionClearedHandler<T> CollectionCleared The change event. Will be raised for every change operation on the collection.
ItemInsertedHandler<T> ItemInserted The item added event. Will be raised for every individual addition to the collection.
ItemRemovedAtHandler<T> ItemRemovedAt The item removed event. Will be raised for every individual removal from the collection.
ItemsAddedHandler<T> ItemsAdded The item added event. Will be raised for every individual addition to the collection.
ItemsRemovedHandler<T> ItemsRemoved The item removed event. Will be raised for every individual removal from the collection.

Property details

EventTypeEnum ActiveEventsAccess: Read-Only

Value:

The ActiveEvents value of the wrapped collection
int CountAccess: Read-Only

Value:The size

Get the size of the wrapped collection
Speed CountSpeedAccess: Read-Only

Value:A characterization of the speed of the Count property in this collection.

The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
bool IsEmptyAccess: Read-Only

Value:The size

Get the size of the wrapped collection
EventTypeEnum ListenableEventsAccess: Read-Only

Value:

The ListenableEvents value of the wrapped collection

Constructor details

GuardedCollectionValue<T>(ICollectionValue<T> collectionvalue) Wrap a ICollectionValue<T> in a read-only wrapper
Parameters:
collectionvalue:the collection to wrap

Method details

bool All(Fun<T,bool> filter) Check if all items in the wrapped enumerable satisfies a specific predicate.
Returns:True if all items satisfies the predicate
Parameters:
filter:A filter delegate () defining the predicate
void Apply(Act<T> a) Apply a delegate to all items of the wrapped enumerable.
Parameters:
a:The delegate to apply
T Choose() Choose some item of this collection.
Throws
NoSuchItemExceptionif collection is empty.
Returns:
void CopyTo(T[] a, int i) Copy the items of the wrapped collection to an array
Parameters:
a:The array
i:Starting offset
bool Exists(Fun<T,bool> filter) Check if there exists an item that satisfies a specific predicate in the wrapped enumerable.
Returns:True is such an item exists
Parameters:
filter:A filter delegate () defining the predicate
IEnumerable<T> Filter(Fun<T,bool> filter) Create an enumerable, enumerating the items of this collection that satisfies a certain condition.
Returns:The filtered enumerable
Parameters:
filter:The T->bool filter delegate defining the condition
bool Find(Fun<T,bool> filter, out T item)
Returns:
Parameters:
filter:
item:
F bool Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider)
Returns:
Parameters:
stringbuilder:
formatProvider:
rest:
T[] ToArray() Create an array from the items of the wrapped collection
Returns:The array
F string ToString(string format, System.IFormatProvider formatProvider)
Returns:
Parameters:
format:
formatProvider: