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.ICollectionValue< T > Interface Template Reference

A generic collection that may be enumerated and can answer efficiently how many items it contains. Like More...

Inheritance diagram for C5.ICollectionValue< T >:
C5.IShowable C5.CollectionValueBase< T > C5.GuardedCollectionValue< T > C5.IDirectedCollectionValue< T > C5.IExtensible< T > C5.CollectionBase< T > C5.DirectedCollectionValueBase< T > C5.IntervalHeap< T > C5.GuardedCollection< T > C5.GuardedDirectedCollectionValue< T > C5.ArrayBase< T >.Range C5.DirectedCollectionBase< T > C5.DirectedCollectionValueBase< T > C5.GuardedDirectedCollectionValue< T > C5.IQueue< T > C5.ISequenced< T > C5.IStack< T > C5.SequencedBase< T > C5.ICollection< T > C5.IPriorityQueue< T >

Public Member Functions

void CopyTo (T[] array, int index)
 Copy the items of this collection to a contiguous part of an array. More...
 
T[] ToArray ()
 Create an array with the items of this collection (in the same order as an enumerator would output them). More...
 
void Apply (Action< T > action)
 Apply a delegate to all items of this collection. More...
 
bool Exists (Func< T, bool > predicate)
 Check if there exists an item that satisfies a specific predicate in this collection. More...
 
bool Find (Func< T, bool > predicate, out T item)
 Check if there exists an item that satisfies a specific predicate in this collection and return the first one in enumeration order. More...
 
bool All (Func< T, bool > predicate)
 Check if all items in this collection satisfies a specific predicate. More...
 
Choose ()
 Choose some item of this collection. More...
 
SCG.IEnumerable< T > Filter (Func< T, bool > filter)
 Create an enumerable, enumerating the items of this collection that satisfies a certain condition. More...
 
- Public Member Functions inherited from C5.IShowable
bool Show (StringBuilder stringbuilder, ref int rest, IFormatProvider formatProvider)
 Format More...
 

Properties

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...
 

Events

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 generic collection that may be enumerated and can answer efficiently how many items it contains. Like

IEnumerable<T>, this interface does not prescribe any operations to initialize or update the collection. The main usage for this interface is to be the return type of query operations on generic collection.

Member Function Documentation

bool C5.ICollectionValue< T >.All ( Func< T, bool >  predicate)

Check if all items in this collection satisfies a specific predicate.

Parameters
predicateA delegate (T:Func`2 with
R == bool
) defining the predicate
Returns
True if all items satisfies the predicate

Implemented in C5.WrappedArray< T >, C5.CollectionValueBase< T >, and C5.GuardedCollectionValue< T >.

void C5.ICollectionValue< T >.Apply ( Action< T >  action)

Apply a delegate to all items of this collection.

Parameters
actionThe delegate to apply

Implemented in C5.WrappedArray< T >, C5.CollectionValueBase< T >, and C5.GuardedCollectionValue< T >.

T C5.ICollectionValue< T >.Choose ( )

Choose some item of this collection.

Implementations must assure that the item returned may be efficiently removed.

Implementors may decide to implement this method in a way such that repeated calls do not necessarily give the same result, i.e. so that the result of the following test is undetermined: coll.Choose() == coll.Choose()

Exceptions
NoSuchItemExceptionif collection is empty.
Returns

Implemented in C5.HashedLinkedList< T >, C5.LinkedList< T >, C5.ArrayBase< T >.Range, C5.ArrayBase< T >, C5.WrappedArray< T >, C5.HashSet< T >, C5.HashBag< T >, C5.TreeBag< T >, C5.TreeSet< T >, C5.CollectionValueBase< T >, C5.IntervalHeap< T >, C5.GuardedCollectionValue< T >, and C5.CircularQueue< T >.

void C5.ICollectionValue< T >.CopyTo ( T[]  array,
int  index 
)

Copy the items of this collection to a contiguous part of an array.

Parameters
arrayThe array to copy to
indexThe index at which to copy the first item

Implemented in C5.IList< T >, C5.WrappedArray< T >, C5.HashBag< T >, C5.CollectionValueBase< T >, C5.ICollection< T >, and C5.GuardedCollectionValue< T >.

bool C5.ICollectionValue< T >.Exists ( Func< T, bool >  predicate)

Check if there exists an item that satisfies a specific predicate in this collection.

Parameters
predicateA delegate (T:Func`2 with
R == bool
) defining the predicate
Returns
True is such an item exists

Implemented in C5.WrappedArray< T >, C5.CollectionValueBase< T >, and C5.GuardedCollectionValue< T >.

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

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

Implemented in C5.HashedLinkedList< T >, C5.LinkedList< T >, C5.WrappedArray< T >, C5.CollectionValueBase< T >, and C5.GuardedCollectionValue< T >.

bool C5.ICollectionValue< T >.Find ( Func< T, bool >  predicate,
out T  item 
)

Check if there exists an item that satisfies a specific predicate in this collection and return the first one in enumeration order.

Parameters
predicateA delegate (T:Func`2 with
R == bool
) defining the predicate
item
Returns
True is such an item exists

Implemented in C5.WrappedArray< T >, C5.CollectionValueBase< T >, and C5.GuardedCollectionValue< T >.

T [] C5.ICollectionValue< T >.ToArray ( )

Create an array with the items of this collection (in the same order as an enumerator would output them).

Returns
The array

Implemented in C5.ArrayBase< T >, C5.WrappedArray< T >, C5.HashSet< T >, C5.CollectionValueBase< T >, C5.HashBag< T >, and C5.GuardedCollectionValue< T >.

Property Documentation

EventTypeEnum C5.ICollectionValue< T >.ActiveEvents
get

A flag bitmap of the events currently subscribed to by this collection.

int C5.ICollectionValue< T >.Count
get

The number of items in this collection

Speed C5.ICollectionValue< 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.

bool C5.ICollectionValue< T >.IsEmpty
get

True if this collection is empty.

EventTypeEnum C5.ICollectionValue< T >.ListenableEvents
get

A flag bitmap of the events subscribable to by this collection.

Event Documentation

CollectionChangedHandler<T> C5.ICollectionValue< T >.CollectionChanged

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

CollectionClearedHandler<T> C5.ICollectionValue< T >.CollectionCleared

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

ItemInsertedHandler<T> C5.ICollectionValue< T >.ItemInserted

The item inserted event. Will be raised for every individual insertion to the collection.

ItemRemovedAtHandler<T> C5.ICollectionValue< T >.ItemRemovedAt

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

ItemsAddedHandler<T> C5.ICollectionValue< T >.ItemsAdded

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

ItemsRemovedHandler<T> C5.ICollectionValue< T >.ItemsRemoved

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


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