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

Base class (abstract) for sequenced collection implementations. More...

Inheritance diagram for C5.SequencedBase< T >:
C5.DirectedCollectionBase< T > C5.IDirectedCollectionValue< T > C5.CollectionBase< T > C5.IDirectedCollectionValue< T > C5.ICollectionValue< T > C5.IDirectedEnumerable< T > C5.CollectionValueBase< T > C5.ICollectionValue< T > C5.IDirectedEnumerable< T > C5.IShowable C5.EnumerableBase< T > C5.ICollectionValue< T > C5.IShowable C5.IShowable C5.IShowable 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 >

Public Member Functions

virtual int GetSequencedHashCode ()
 Get the sequenced collection hash code of this collection: from the cached value if present and up to date, else (re)compute. More...
 
virtual bool SequencedEquals (ISequenced< T > otherCollection)
 Check if the contents of that is equal to the contents of this in the sequenced sense. Using the item equalityComparer of this collection. More...
 
abstract override SCG.IEnumerator< T > GetEnumerator ()
 Create an enumerator for this collection. More...
 
int FindIndex (Func< T, bool > predicate)
 Check if there exists an item that satisfies a specific predicate in this collection and return the index of the first one. More...
 
int FindLastIndex (Func< T, bool > predicate)
 Check if there exists an item that satisfies a specific predicate in this collection and return the index of the last one. More...
 
- Public Member Functions inherited from C5.DirectedCollectionBase< T >
abstract IDirectedCollectionValue< T > Backwards ()
 
virtual bool FindLast (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...
 
- Public Member Functions inherited from C5.CollectionBase< T >
virtual int GetUnsequencedHashCode ()
 Get the unsequenced collection hash code of this collection: from the cached value if present and up to date, else (re)compute. More...
 
virtual bool UnsequencedEquals (ICollection< T > otherCollection)
 Check if the contents of otherCollection is equal to the contents of this in the unsequenced sense. Uses the item equality comparer of this collection More...
 
- Public Member Functions inherited from C5.CollectionValueBase< T >
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...
 
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...
 

Static Public Member Functions

static int ComputeHashCode (ISequenced< T > items, SCG.IEqualityComparer< T > itemequalityComparer)
 Compute the unsequenced hash code of a collection More...
 
static bool StaticEquals (ISequenced< T > collection1, ISequenced< T > collection2, SCG.IEqualityComparer< T > itemequalityComparer)
 Examine if tit and tat are equal as sequenced collections using the specified item equalityComparer (assumed compatible with the two collections). More...
 
- Static Public Member Functions inherited from C5.CollectionBase< T >
static int ComputeHashCode (ICollectionValue< T > items, SCG.IEqualityComparer< T > itemequalityComparer)
 Compute the unsequenced hash code of a collection More...
 
static bool StaticEquals (ICollection< T > collection1, ICollection< T > collection2, SCG.IEqualityComparer< T > itemequalityComparer)
 Examine if collection1 and collection2 are equal as unsequenced collections using the specified item equalityComparer (assumed compatible with the two collections). More...
 

Protected Member Functions

 SequencedBase (SCG.IEqualityComparer< T > itemequalityComparer)
 
- Protected Member Functions inherited from C5.DirectedCollectionBase< T >
 DirectedCollectionBase (SCG.IEqualityComparer< T > itemequalityComparer)
 
- Protected Member Functions inherited from C5.CollectionBase< T >
 CollectionBase (SCG.IEqualityComparer< T > itemequalityComparer)
 
void checkRange (int start, int count)
 Utility method for range checking. More...
 
virtual void modifycheck (int thestamp)
 Check if the collection has been modified since a specified time, expressed as a stamp value. More...
 
virtual void updatecheck ()
 Check if it is valid to perform update operations, and if so increment stamp. More...
 
- Protected Member Functions inherited from C5.CollectionValueBase< T >
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

override EnumerationDirection Direction [get]
 
- Properties inherited from C5.DirectedCollectionBase< T >
virtual EnumerationDirection Direction [get]
 
- Properties inherited from C5.CollectionBase< T >
virtual bool IsReadOnly [get]
 
override int Count [get]
 
override 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...
 
virtual SCG.IEqualityComparer< T > EqualityComparer [get]
 
override bool IsEmpty [get]
 
- Properties inherited from C5.CollectionValueBase< T >
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...
 
- Properties inherited from C5.IDirectedEnumerable< T >
EnumerationDirection Direction [get]
 

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...
 
- Protected Attributes inherited from C5.CollectionBase< T >
bool isReadOnlyBase = false
 The underlying field of the ReadOnly property More...
 
int stamp
 The current stamp value More...
 
int size
 The number of items in the collection More...
 
readonly SCG.IEqualityComparer< T > itemequalityComparer
 The item equalityComparer of the collection 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 (abstract) for sequenced collection implementations.

Constructor & Destructor Documentation

C5.SequencedBase< T >.SequencedBase ( SCG.IEqualityComparer< T >  itemequalityComparer)
protected

Parameters
itemequalityComparer

Member Function Documentation

static int C5.SequencedBase< T >.ComputeHashCode ( ISequenced< T >  items,
SCG.IEqualityComparer< T >  itemequalityComparer 
)
static

Compute the unsequenced hash code of a collection

Parameters
itemsThe collection to compute hash code for
itemequalityComparerThe item equalitySCG.Comparer
Returns
The hash code
int C5.SequencedBase< T >.FindIndex ( Func< T, bool >  predicate)

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

Parameters
predicateA delegate defining the predicate
Returns
the index, if found, a negative value else
int C5.SequencedBase< T >.FindLastIndex ( Func< T, bool >  predicate)

Check if there exists an item that satisfies a specific predicate in this collection and return the index of the last one.

Parameters
predicateA delegate defining the predicate
Returns
the index, if found, a negative value else
abstract override SCG.IEnumerator<T> C5.SequencedBase< T >.GetEnumerator ( )
pure virtual
virtual int C5.SequencedBase< T >.GetSequencedHashCode ( )
virtual

Get the sequenced collection hash code of this collection: from the cached value if present and up to date, else (re)compute.

Returns
The hash code

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

virtual bool C5.SequencedBase< T >.SequencedEquals ( ISequenced< T >  otherCollection)
virtual

Check if the contents of that is equal to the contents of this in the sequenced sense. Using the item equalityComparer of this collection.

Parameters
otherCollectionThe collection to compare to.
Returns
True if equal

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

static bool C5.SequencedBase< T >.StaticEquals ( ISequenced< T >  collection1,
ISequenced< T >  collection2,
SCG.IEqualityComparer< T >  itemequalityComparer 
)
static

Examine if tit and tat are equal as sequenced collections using the specified item equalityComparer (assumed compatible with the two collections).

Parameters
collection1The first collection
collection2The second collection
itemequalityComparerThe item equalityComparer to use for comparison
Returns
True if equal

Property Documentation

override EnumerationDirection C5.SequencedBase< T >.Direction
get

Forwards if same, else Backwards

The enumeration direction relative to the original collection.


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