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.CollectionValueBase< T > Class Template Referenceabstract

Base class for classes implementing ICollectionValue[T] More...

Inheritance diagram for C5.CollectionValueBase< T >:
C5.EnumerableBase< T > C5.ICollectionValue< T > C5.IShowable C5.IShowable C5.CollectionBase< T > C5.DirectedCollectionValueBase< T > C5.IntervalHeap< T > C5.DirectedCollectionBase< T > C5.HashBag< T > C5.HashSet< T > C5.ArrayBase< T >.Range C5.SequencedBase< T > C5.ArrayBase< T > C5.CircularQueue< T > C5.HashedLinkedList< T > C5.LinkedList< T > C5.TreeBag< T > C5.TreeSet< T > C5.ArrayList< T > C5.HashedArrayList< T > C5.SortedArray< T >

Classes

class  RaiseForRemoveAllHandler
 

Public Member Functions

virtual void CopyTo (T[] array, int index)
 Copy the items of this collection to part of an array. More...
 
virtual T[] ToArray ()
 Create an array with the items of this collection (in the same order as an enumerator would output them). More...
 
virtual void Apply (Action< T > action)
 Apply an single argument action, T:Action`1 to this enumerable More...
 
virtual bool Exists (Func< T, bool > predicate)
 Check if there exists an item that satisfies a specific predicate in this collection. More...
 
virtual 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...
 
virtual bool All (Func< T, bool > predicate)
 Check if all items in this collection satisfies a specific predicate. More...
 
virtual SCG.IEnumerable< T > Filter (Func< T, bool > predicate)
 Create an enumerable, enumerating the items of this collection that satisfies a certain condition. More...
 
abstract T Choose ()
 Choose some item of this collection. More...
 
abstract override SCG.IEnumerator< T > GetEnumerator ()
 Create an enumerator for this collection. More...
 
virtual bool Show (System.Text.StringBuilder stringbuilder, ref int rest, IFormatProvider formatProvider)
 
virtual string ToString (string format, IFormatProvider formatProvider)
 
override string ToString ()
 
- Public Member Functions inherited from C5.IShowable
bool Show (StringBuilder stringbuilder, ref int rest, IFormatProvider formatProvider)
 Format More...
 

Protected Member Functions

virtual void raiseCollectionChanged ()
 Fire the CollectionChanged event More...
 
virtual void raiseCollectionCleared (bool full, int count)
 Fire the CollectionCleared event More...
 
virtual void raiseCollectionCleared (bool full, int count, int?offset)
 Fire the CollectionCleared event More...
 
virtual void raiseItemsAdded (T item, int count)
 Fire the ItemsAdded event More...
 
virtual void raiseItemsRemoved (T item, int count)
 Fire the ItemsRemoved event More...
 
virtual void raiseItemInserted (T item, int index)
 Fire the ItemInserted event More...
 
virtual void raiseItemRemovedAt (T item, int index)
 Fire the ItemRemovedAt event More...
 
virtual void raiseForSetThis (int index, T value, T item)
 
virtual void raiseForInsert (int i, T item)
 
void raiseForRemove (T item)
 
void raiseForRemove (T item, int count)
 
void raiseForRemoveAt (int index, T item)
 
virtual void raiseForUpdate (T newitem, T olditem)
 
virtual void raiseForUpdate (T newitem, T olditem, int count)
 
virtual void raiseForAdd (T item)
 
virtual void raiseForRemoveAll (ICollectionValue< T > wasRemoved)
 

Properties

virtual EventTypeEnum ListenableEvents [get]
 
virtual EventTypeEnum ActiveEvents [get]
 A flag bitmap of the events currently subscribed to by this collection. More...
 
virtual CollectionChangedHandler< T > CollectionChanged
 The change event. Will be raised for every change operation on the collection. More...
 
virtual CollectionClearedHandler< T > CollectionCleared
 The clear event. Will be raised for every Clear operation on the collection. More...
 
virtual ItemsAddedHandler< T > ItemsAdded
 The item added event. Will be raised for every individual addition to the collection. More...
 
virtual ItemsRemovedHandler< T > ItemsRemoved
 The item removed event. Will be raised for every individual removal from the collection. More...
 
virtual ItemInsertedHandler< T > ItemInserted
 The item added event. Will be raised for every individual addition to the collection. More...
 
virtual ItemRemovedAtHandler< T > ItemRemovedAt
 The item removed event. Will be raised for every individual removal from the collection. More...
 
abstract bool IsEmpty [get]
 Check if collection is empty. More...
 
abstract int Count [get]
 The number of items in this collection. More...
 
abstract 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

- Static Protected Member Functions inherited from C5.EnumerableBase< T >
static int countItems (SCG.IEnumerable< T > items)
 Count the number of items in an enumerable by enumeration More...
 
- 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

Base class for classes implementing ICollectionValue[T]

Member Function Documentation

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

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

Implements C5.ICollectionValue< T >.

virtual void C5.CollectionValueBase< T >.Apply ( Action< T >  action)
virtual

Apply an single argument action, T:Action`1 to this enumerable

Parameters
actionThe action delegate

Implements C5.ICollectionValue< T >.

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

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

Exceptions
ArgumentOutOfRangeExceptionif
index
is not a valid index into the array (i.e. negative or greater than the size of the array) or the array does not have room for the items.
Parameters
arrayThe array to copy to.
indexThe starting index.

Implements C5.ICollectionValue< T >.

Reimplemented in C5.HashBag< T >.

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

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 if such an item exists

Implements C5.ICollectionValue< T >.

virtual SCG.IEnumerable<T> C5.CollectionValueBase< T >.Filter ( Func< T, bool >  predicate)
virtual

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

Parameters
predicateA delegate (T:Func`2 with
R = bool
) defining the predicate
Returns
The filtered enumerable

Implements C5.ICollectionValue< T >.

Reimplemented in C5.HashedLinkedList< T >, and C5.LinkedList< T >.

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

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

Implements C5.ICollectionValue< T >.

virtual void C5.CollectionValueBase< T >.raiseCollectionChanged ( )
protectedvirtual

Fire the CollectionChanged event

virtual void C5.CollectionValueBase< T >.raiseCollectionCleared ( bool  full,
int  count 
)
protectedvirtual

Fire the CollectionCleared event

virtual void C5.CollectionValueBase< T >.raiseCollectionCleared ( bool  full,
int  count,
int?  offset 
)
protectedvirtual

Fire the CollectionCleared event

virtual void C5.CollectionValueBase< T >.raiseForAdd ( item)
protectedvirtual

Parameters
item
virtual void C5.CollectionValueBase< T >.raiseForInsert ( int  i,
item 
)
protectedvirtual

Parameters
i
item
void C5.CollectionValueBase< T >.raiseForRemove ( item)
protected

Parameters
item
void C5.CollectionValueBase< T >.raiseForRemove ( item,
int  count 
)
protected

Parameters
item
count
virtual void C5.CollectionValueBase< T >.raiseForRemoveAll ( ICollectionValue< T >  wasRemoved)
protectedvirtual

Parameters
wasRemoved
void C5.CollectionValueBase< T >.raiseForRemoveAt ( int  index,
item 
)
protected

Parameters
index
item
virtual void C5.CollectionValueBase< T >.raiseForSetThis ( int  index,
value,
item 
)
protectedvirtual

Parameters
index
value
item
virtual void C5.CollectionValueBase< T >.raiseForUpdate ( newitem,
olditem 
)
protectedvirtual

Parameters
newitem
olditem
virtual void C5.CollectionValueBase< T >.raiseForUpdate ( newitem,
olditem,
int  count 
)
protectedvirtual

Parameters
newitem
olditem
count
virtual void C5.CollectionValueBase< T >.raiseItemInserted ( item,
int  index 
)
protectedvirtual

Fire the ItemInserted event

Parameters
itemThe item that was added
index
virtual void C5.CollectionValueBase< T >.raiseItemRemovedAt ( item,
int  index 
)
protectedvirtual

Fire the ItemRemovedAt event

Parameters
itemThe item that was removed
index
virtual void C5.CollectionValueBase< T >.raiseItemsAdded ( item,
int  count 
)
protectedvirtual

Fire the ItemsAdded event

Parameters
itemThe item that was added
count
virtual void C5.CollectionValueBase< T >.raiseItemsRemoved ( item,
int  count 
)
protectedvirtual

Fire the ItemsRemoved event

Parameters
itemThe item that was removed
count
virtual bool C5.CollectionValueBase< T >.Show ( System.Text.StringBuilder  stringbuilder,
ref int  rest,
IFormatProvider  formatProvider 
)
virtual

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

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

Returns
The array

Implements C5.ICollectionValue< T >.

Reimplemented in C5.ArrayBase< T >, C5.HashSet< T >, and C5.HashBag< T >.

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

Parameters
format
formatProvider
Returns
override string C5.CollectionValueBase< T >.ToString ( )

Returns

Property Documentation

virtual EventTypeEnum C5.CollectionValueBase< T >.ActiveEvents
get

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

virtual CollectionChangedHandler<T> C5.CollectionValueBase< T >.CollectionChanged
addremove

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

virtual CollectionClearedHandler<T> C5.CollectionValueBase< T >.CollectionCleared
addremove

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

abstract int C5.CollectionValueBase< T >.Count
get

The number of items in this collection.

abstract Speed C5.CollectionValueBase< 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.

abstract bool C5.CollectionValueBase< T >.IsEmpty
get

Check if collection is empty.

True if empty

virtual ItemInsertedHandler<T> C5.CollectionValueBase< T >.ItemInserted
addremove

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

virtual ItemRemovedAtHandler<T> C5.CollectionValueBase< T >.ItemRemovedAt
addremove

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

virtual ItemsAddedHandler<T> C5.CollectionValueBase< T >.ItemsAdded
addremove

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

virtual ItemsRemovedHandler<T> C5.CollectionValueBase< T >.ItemsRemoved
addremove

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

virtual EventTypeEnum C5.CollectionValueBase< T >.ListenableEvents
get


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