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.GuardedSequenced< T > Class Template Reference

A read-only wrapper for a sequenced collection More...

Inheritance diagram for C5.GuardedSequenced< T >:
C5.GuardedCollection< T > C5.ISequenced< T > C5.GuardedCollectionValue< T > C5.ICollection< T > C5.ICollection< T > C5.IDirectedCollectionValue< T > C5.IDirectedEnumerable< T > C5.ICollectionValue< T > C5.IExtensible< T > C5.IExtensible< T > C5.ICollectionValue< T > C5.GuardedEnumerable< T > C5.GuardedList< T > C5.GuardedSorted< T > C5.GuardedIndexedSorted< T >

Public Member Functions

 GuardedSequenced (ISequenced< T > sorted)
 Wrap a sequenced collection in a read-only wrapper 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...
 
int GetSequencedHashCode ()
 
bool SequencedEquals (ISequenced< T > that)
 
virtual IDirectedCollectionValue< T > Backwards ()
 Get a collection that enumerates the wrapped collection in the opposite direction More...
 
virtual bool FindLast (Func< T, bool > predicate, out T item)
 
- Public Member Functions inherited from C5.GuardedCollection< T >
 GuardedCollection (ICollection< T > collection)
 Wrap an ICollection<T> in a read-only wrapper More...
 
virtual int GetUnsequencedHashCode ()
 
virtual bool UnsequencedEquals (ICollection< T > that)
 
virtual bool Contains (T item)
 Check if an item is in the wrapped collection More...
 
virtual int ContainsCount (T item)
 Count the number of times an item appears in the wrapped collection More...
 
virtual ICollectionValue< T > UniqueItems ()
 
virtual ICollectionValue< KeyValuePair< T, int > > ItemMultiplicities ()
 
virtual bool ContainsAll (SCG.IEnumerable< T > items)
 Check if all items in the argument is in the wrapped collection More...
 
virtual bool Find (ref T item)
 Search for an item in the wrapped collection More...
 
virtual bool FindOrAdd (ref T item)
 
virtual bool Update (T item)
 
virtual bool Update (T item, out T olditem)
 
virtual bool UpdateOrAdd (T item)
 
virtual bool UpdateOrAdd (T item, out T olditem)
 
virtual bool Remove (T item)
 
virtual bool Remove (T item, out T removeditem)
 
virtual void RemoveAllCopies (T item)
 
virtual void RemoveAll (SCG.IEnumerable< T > items)
 
virtual void Clear ()
 
virtual void RetainAll (SCG.IEnumerable< T > items)
 
virtual bool Check ()
 Check wrapped collection for internal consistency More...
 
virtual bool Add (T item)
 
virtual void AddAll (SCG.IEnumerable< T > items)
 
- Public Member Functions inherited from C5.GuardedCollectionValue< T >
 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...
 
- Public Member Functions inherited from C5.ICollection< T >
new void CopyTo (T[] array, int index)
 Copy the items of this collection to a contiguous part of an array. More...
 

Properties

EnumerationDirection Direction [get]
 
- Properties inherited from C5.GuardedCollection< T >
virtual bool IsReadOnly [get]
 (This is a read-only wrapper) More...
 
virtual Speed ContainsSpeed [get]
 
virtual bool AllowsDuplicates [get]
 
virtual SCG.IEqualityComparer< T > EqualityComparer [get]
 
virtual bool DuplicatesByCounting [get]
 By convention this is true for any collection with set semantics. More...
 
override bool IsEmpty [get]
 
- Properties inherited from C5.GuardedCollectionValue< T >
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...
 
- Properties inherited from C5.ICollection< T >
Speed ContainsSpeed [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...
 
new int Count [get]
 
new bool IsReadOnly [get]
 If true any call of an updating operation will throw an More...
 
- Properties inherited from C5.IExtensible< T >
bool IsReadOnly [get]
 If true any call of an updating operation will throw an More...
 
bool AllowsDuplicates [get]
 
SCG.IEqualityComparer< T > EqualityComparer [get]
 (Here should be a discussion of the role of equalityComparers. Any ). More...
 
bool DuplicatesByCounting [get]
 By convention this is true for any collection with set semantics. More...
 
- Properties inherited from C5.IDirectedEnumerable< T >
EnumerationDirection Direction [get]
 

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 a sequenced collection

This is mainly interesting as a base of other guard classes

Constructor & Destructor Documentation

Wrap a sequenced collection in a read-only wrapper

Parameters
sorted

Member Function Documentation

virtual IDirectedCollectionValue<T> C5.GuardedSequenced< T >.Backwards ( )
virtual

Get a collection that enumerates the wrapped collection in the opposite direction

Returns
The mirrored collection

Implements C5.IDirectedCollectionValue< T >.

int C5.GuardedSequenced< 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 (T:Func`2 with
R == bool
) defining the predicate
Returns
the index, if found, a negative value else
virtual bool C5.GuardedSequenced< T >.FindLast ( Func< T, bool >  predicate,
out T  item 
)
virtual

Parameters
predicate
item
Returns

Implements C5.IDirectedCollectionValue< T >.

int C5.GuardedSequenced< 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 (T:Func`2 with
R == bool
) defining the predicate
Returns
the index, if found, a negative value else
int C5.GuardedSequenced< T >.GetSequencedHashCode ( )

Returns

Implements C5.ISequenced< T >.

bool C5.GuardedSequenced< T >.SequencedEquals ( ISequenced< T >  that)

Parameters
that
Returns

Implements C5.ISequenced< T >.

Property Documentation

Forwards if same, else Backwards

The enumeration direction relative to the original collection.


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