C5  2.4
The C5 Generic Collection Library for C# and CLI is a comprehensive collection library supporting lists, sets, bags, dictionaries, priority queues, (FIFO) queues, and (LIFO) stacks. C5 runs on .NET 3.5+, Silverlight 5, Windows Phone 8, Xamarin.iOS, Xamarin.Android, and Mono.
C5.GuardedCollectionValue< T > Class Template Reference

A read-only wrapper for an ICollectionValue<T> More...

Inheritance diagram for C5.GuardedCollectionValue< T >:
C5.GuardedEnumerable< T > C5.ICollectionValue< T > C5.IShowable C5.GuardedCollection< T > C5.GuardedDirectedCollectionValue< T > C5.GuardedSequenced< T > C5.GuardedQueue< T > C5.GuardedList< T > C5.GuardedSorted< T > C5.GuardedIndexedSorted< T >

Public Member Functions

 GuardedCollectionValue (ICollectionValue< T > collectionvalue)
 Wrap a ICollectionValue<T> in a read-only wrapper More...
 
virtual void CopyTo (T[] a, int i)
 Copy the items of the wrapped collection to an array More...
 
virtual T[] ToArray ()
 Create an array from the items of the wrapped collection More...
 
virtual void Apply (Action< T > a)
 Apply a delegate to all items of the wrapped enumerable. More...
 
virtual bool Exists (Func< T, bool > filter)
 Check if there exists an item that satisfies a specific predicate in the wrapped enumerable. More...
 
virtual bool Find (Func< T, bool > filter, out T item)
 
virtual bool All (Func< T, bool > filter)
 Check if all items in the wrapped enumerable satisfies a specific predicate. More...
 
virtual SCG.IEnumerable< T > Filter (Func< T, bool > filter)
 Create an enumerable, enumerating the items of this collection that satisfies a certain condition. More...
 
virtual T Choose ()
 Choose some item of this collection. More...
 
bool Show (System.Text.StringBuilder stringbuilder, ref int rest, IFormatProvider formatProvider)
 
string ToString (string format, IFormatProvider formatProvider)
 
- Public Member Functions inherited from C5.GuardedEnumerable< T >
 GuardedEnumerable (SCG.IEnumerable< T > enumerable)
 Wrap an enumerable in a read-only wrapper More...
 
SCG.IEnumerator< T > GetEnumerator ()
 Get an enumerator from the wrapped enumerable More...
 
- Public Member Functions inherited from C5.IShowable
bool Show (StringBuilder stringbuilder, ref int rest, IFormatProvider formatProvider)
 Format More...
 

Properties

virtual EventTypeEnum ListenableEvents [get]
 The ListenableEvents value of the wrapped collection More...
 
virtual EventTypeEnum ActiveEvents [get]
 The ActiveEvents value of the wrapped collection More...
 
CollectionChangedHandler< T > CollectionChanged
 The change event. Will be raised for every change operation on the collection. More...
 
CollectionClearedHandler< T > CollectionCleared
 The change event. Will be raised for every change operation on the collection. More...
 
ItemsAddedHandler< T > ItemsAdded
 The item added event. Will be raised for every individual addition to the collection. More...
 
ItemInsertedHandler< T > ItemInserted
 The item added event. Will be raised for every individual addition to the collection. More...
 
ItemsRemovedHandler< T > ItemsRemoved
 The item removed event. Will be raised for every individual removal from the collection. More...
 
ItemRemovedAtHandler< T > ItemRemovedAt
 The item removed event. Will be raised for every individual removal from the collection. More...
 
virtual bool IsEmpty [get]
 Get the size of the wrapped collection More...
 
virtual int Count [get]
 Get the size of the wrapped collection More...
 
virtual Speed CountSpeed [get]
 The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant). More...
 
- Properties inherited from C5.ICollectionValue< T >
EventTypeEnum ListenableEvents [get]
 A flag bitmap of the events subscribable to by this collection. More...
 
EventTypeEnum ActiveEvents [get]
 A flag bitmap of the events currently subscribed to by this collection. More...
 
bool IsEmpty [get]
 
int Count [get]
 
Speed CountSpeed [get]
 The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant). More...
 

Additional Inherited Members

- Events inherited from C5.ICollectionValue< T >
CollectionChangedHandler< T > CollectionChanged
 The change event. Will be raised for every change operation on the collection. More...
 
CollectionClearedHandler< T > CollectionCleared
 The change event. Will be raised for every clear operation on the collection. More...
 
ItemsAddedHandler< T > ItemsAdded
 The item added event. Will be raised for every individual addition to the collection. More...
 
ItemInsertedHandler< T > ItemInserted
 The item inserted event. Will be raised for every individual insertion to the collection. More...
 
ItemsRemovedHandler< T > ItemsRemoved
 The item removed event. Will be raised for every individual removal from the collection. More...
 
ItemRemovedAtHandler< T > ItemRemovedAt
 The item removed at event. Will be raised for every individual removal at from the collection. More...
 

Detailed Description

A read-only wrapper for an ICollectionValue<T>

This is mainly interesting as a base of other guard classes

Constructor & Destructor Documentation

Wrap a ICollectionValue<T> in a read-only wrapper

Parameters
collectionvaluethe collection to wrap

Member Function Documentation

virtual bool C5.GuardedCollectionValue< T >.All ( Func< T, bool >  filter)
virtual

Check if all items in the wrapped enumerable satisfies a specific predicate.

Parameters
filterA filter delegate (T:C5.Filter`1) defining the predicate
Returns
True if all items satisfies the predicate

Implements C5.ICollectionValue< T >.

virtual void C5.GuardedCollectionValue< T >.Apply ( Action< T >  a)
virtual

Apply a delegate to all items of the wrapped enumerable.

Parameters
aThe delegate to apply

Implements C5.ICollectionValue< T >.

virtual T C5.GuardedCollectionValue< T >.Choose ( )
virtual

Choose some item of this collection.

Exceptions
NoSuchItemExceptionif collection is empty.
Returns

Implements C5.ICollectionValue< T >.

virtual void C5.GuardedCollectionValue< T >.CopyTo ( T[]  a,
int  i 
)
virtual

Copy the items of the wrapped collection to an array

Parameters
aThe array
iStarting offset

Implements C5.ICollectionValue< T >.

virtual bool C5.GuardedCollectionValue< T >.Exists ( Func< T, bool >  filter)
virtual

Check if there exists an item that satisfies a specific predicate in the wrapped enumerable.

Parameters
filterA filter delegate (T:C5.Filter`1) defining the predicate
Returns
True is such an item exists

Implements C5.ICollectionValue< T >.

virtual SCG.IEnumerable<T> C5.GuardedCollectionValue< T >.Filter ( Func< T, bool >  filter)
virtual

Create an enumerable, enumerating the items of this collection that satisfies a certain condition.

Parameters
filterThe T->bool filter delegate defining the condition
Returns
The filtered enumerable

Implements C5.ICollectionValue< T >.

virtual bool C5.GuardedCollectionValue< T >.Find ( Func< T, bool >  filter,
out T  item 
)
virtual

Parameters
filter
item
Returns

Implements C5.ICollectionValue< T >.

bool C5.GuardedCollectionValue< T >.Show ( System.Text.StringBuilder  stringbuilder,
ref int  rest,
IFormatProvider  formatProvider 
)

Parameters
stringbuilder
formatProvider
rest
Returns
virtual T [] C5.GuardedCollectionValue< T >.ToArray ( )
virtual

Create an array from the items of the wrapped collection

Returns
The array

Implements C5.ICollectionValue< T >.

string C5.GuardedCollectionValue< T >.ToString ( string  format,
IFormatProvider  formatProvider 
)

Parameters
format
formatProvider
Returns

Property Documentation

virtual EventTypeEnum C5.GuardedCollectionValue< T >.ActiveEvents
get

The ActiveEvents value of the wrapped collection

CollectionChangedHandler<T> C5.GuardedCollectionValue< T >.CollectionChanged
addremove

The change event. Will be raised for every change operation on the collection.

CollectionClearedHandler<T> C5.GuardedCollectionValue< T >.CollectionCleared
addremove

The change event. Will be raised for every change operation on the collection.

virtual int C5.GuardedCollectionValue< T >.Count
get

Get the size of the wrapped collection

The size

virtual Speed C5.GuardedCollectionValue< T >.CountSpeed
get

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

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

virtual bool C5.GuardedCollectionValue< T >.IsEmpty
get

Get the size of the wrapped collection

The size

ItemInsertedHandler<T> C5.GuardedCollectionValue< T >.ItemInserted
addremove

The item added event. Will be raised for every individual addition to the collection.

ItemRemovedAtHandler<T> C5.GuardedCollectionValue< T >.ItemRemovedAt
addremove

The item removed event. Will be raised for every individual removal from the collection.

ItemsAddedHandler<T> C5.GuardedCollectionValue< T >.ItemsAdded
addremove

The item added event. Will be raised for every individual addition to the collection.

ItemsRemovedHandler<T> C5.GuardedCollectionValue< T >.ItemsRemoved
addremove

The item removed event. Will be raised for every individual removal from the collection.

virtual EventTypeEnum C5.GuardedCollectionValue< T >.ListenableEvents
get

The ListenableEvents value of the wrapped collection


The documentation for this class was generated from the following file: