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

Read-only wrapper for indexed sorted collections More...

Inheritance diagram for C5.GuardedIndexedSorted< T >:
C5.GuardedSorted< T > C5.IIndexedSorted< T > C5.GuardedSequenced< T > C5.ISorted< T > C5.ISorted< T > C5.IIndexed< T > C5.GuardedCollection< T > C5.ISequenced< T > C5.ISequenced< T > C5.ISequenced< T > C5.ISequenced< T > C5.IDirectedCollectionValue< T > C5.ICollection< T > C5.IDirectedCollectionValue< T > C5.ICollection< T > C5.IDirectedCollectionValue< T > C5.ICollection< T > C5.IDirectedCollectionValue< T > C5.ICollection< T > C5.ICollection< T > C5.GuardedCollectionValue< T >

Public Member Functions

 GuardedIndexedSorted (IIndexedSorted< T > list)
 Wrap an indexed sorted collection in a read-only wrapper More...
 
new IDirectedCollectionValue< T > RangeFrom (T bot)
 Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.) More...
 
new IDirectedCollectionValue< T > RangeFromTo (T bot, T top)
 Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.) More...
 
new IDirectedCollectionValue< T > RangeTo (T top)
 Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.) More...
 
int CountFrom (T bot)
 Report the number of items in the specified range of the wrapped collection More...
 
int CountFromTo (T bot, T top)
 Report the number of items in the specified range of the wrapped collection More...
 
int CountTo (T top)
 Report the number of items in the specified range of the wrapped collection More...
 
IIndexedSorted< T > FindAll (Func< T, bool > f)
 Run FindAll on the wrapped collection with the indicated filter. The result will not be read-only. More...
 
IIndexedSorted< V > Map< V > (Func< T, V > m, SCG.IComparer< V > c)
 Run Map on the wrapped collection with the indicated mapper. The result will not be read-only. More...
 
int IndexOf (T item)
 Find the (first) index of an item in the wrapped collection More...
 
int LastIndexOf (T item)
 Find the last index of an item in the wrapped collection More...
 
RemoveAt (int i)
 
void RemoveInterval (int start, int count)
 
- Public Member Functions inherited from C5.GuardedSorted< T >
 GuardedSorted (ISorted< T > sorted)
 Wrap a sorted collection in a read-only wrapper More...
 
bool TryPredecessor (T item, out T res)
 Find the strict predecessor of item in the guarded sorted collection, that is, the greatest item in the collection smaller than the item. More...
 
bool TrySuccessor (T item, out T res)
 Find the strict successor of item in the guarded sorted collection, that is, the least item in the collection greater than the supplied value. More...
 
bool TryWeakPredecessor (T item, out T res)
 Find the weak predecessor of item in the guarded sorted collection, that is, the greatest item in the collection smaller than or equal to the item. More...
 
bool TryWeakSuccessor (T item, out T res)
 Find the weak successor of item in the sorted collection, that is, the least item in the collection greater than or equal to the supplied value. More...
 
Predecessor (T item)
 Find the predecessor of the item in the wrapped sorted collection More...
 
Successor (T item)
 Find the Successor of the item in the wrapped sorted collection More...
 
WeakPredecessor (T item)
 Find the weak predecessor of the item in the wrapped sorted collection More...
 
WeakSuccessor (T item)
 Find the weak Successor of the item in the wrapped sorted collection More...
 
bool Cut (IComparable< T > c, out T low, out bool lval, out T high, out bool hval)
 Run Cut on the wrapped sorted collection More...
 
IDirectedEnumerable< T > RangeFrom (T bot)
 Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.) More...
 
IDirectedEnumerable< T > RangeFromTo (T bot, T top)
 Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.) More...
 
IDirectedEnumerable< T > RangeTo (T top)
 Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.) More...
 
IDirectedCollectionValue< T > RangeAll ()
 Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.) More...
 
void AddSorted (SCG.IEnumerable< T > items)
 
void RemoveRangeFrom (T low)
 
void RemoveRangeFromTo (T low, T hi)
 
void RemoveRangeTo (T hi)
 
FindMin ()
 Find the minimum of the wrapped collection More...
 
DeleteMin ()
 
FindMax ()
 Find the maximum of the wrapped collection More...
 
DeleteMax ()
 
- Public Member Functions inherited from C5.GuardedSequenced< T >
 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 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...
 
- Public Member Functions inherited from C5.IIndexed< T >
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...
 

Properties

this[int i] [get]
 
virtual Speed IndexingSpeed [get]
 
IDirectedCollectionValue< T > this[int start, int end] [get]
 
- Properties inherited from C5.GuardedSorted< T >
SCG.IComparer< T > Comparer [get]
 The comparer object supplied at creation time for the underlying collection More...
 
- Properties inherited from C5.GuardedSequenced< T >
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]
 
- Properties inherited from C5.ISorted< T >
SCG.IComparer< T > Comparer [get]
 The comparer object supplied at creation time for this sorted collection. More...
 
- Properties inherited from C5.IIndexed< T >
Speed IndexingSpeed [get]
 
IDirectedCollectionValue< T > this[int start, int count] [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

Read-only wrapper for indexed sorted collections

Suitable for wrapping TreeSet, TreeBag and SortedArray

Constructor & Destructor Documentation

Wrap an indexed sorted collection in a read-only wrapper

Parameters
listthe indexed sorted collection

Member Function Documentation

int C5.GuardedIndexedSorted< T >.CountFrom ( bot)

Report the number of items in the specified range of the wrapped collection

Parameters
bot
Returns

Implements C5.IIndexedSorted< T >.

int C5.GuardedIndexedSorted< T >.CountFromTo ( bot,
top 
)

Report the number of items in the specified range of the wrapped collection

Parameters
bot
top
Returns

Implements C5.IIndexedSorted< T >.

int C5.GuardedIndexedSorted< T >.CountTo ( top)

Report the number of items in the specified range of the wrapped collection

Parameters
top
Returns

Implements C5.IIndexedSorted< T >.

IIndexedSorted<T> C5.GuardedIndexedSorted< T >.FindAll ( Func< T, bool >  f)

Run FindAll on the wrapped collection with the indicated filter. The result will not be read-only.

Parameters
f
Returns

Implements C5.IIndexedSorted< T >.

int C5.GuardedIndexedSorted< T >.IndexOf ( item)

Find the (first) index of an item in the wrapped collection

Parameters
item
Returns

Implements C5.IIndexed< T >.

int C5.GuardedIndexedSorted< T >.LastIndexOf ( item)

Find the last index of an item in the wrapped collection

Parameters
item
Returns

Implements C5.IIndexed< T >.

IIndexedSorted<V> C5.GuardedIndexedSorted< T >.Map< V > ( Func< T, V >  m,
SCG.IComparer< V >  c 
)

Run Map on the wrapped collection with the indicated mapper. The result will not be read-only.

Parameters
m
cThe comparer to use in the result
Returns

Implements C5.IIndexedSorted< T >.

new IDirectedCollectionValue<T> C5.GuardedIndexedSorted< T >.RangeFrom ( bot)

Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)

Parameters
bot
Returns

Implements C5.IIndexedSorted< T >.

new IDirectedCollectionValue<T> C5.GuardedIndexedSorted< T >.RangeFromTo ( bot,
top 
)

Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)

Parameters
bot
top
Returns

Implements C5.IIndexedSorted< T >.

new IDirectedCollectionValue<T> C5.GuardedIndexedSorted< T >.RangeTo ( top)

Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)

Parameters
top
Returns

Implements C5.IIndexedSorted< T >.

T C5.GuardedIndexedSorted< T >.RemoveAt ( int  i)

Exceptions
ReadOnlyCollectionExceptionsince this is a read-only wrapper
Parameters
i
Returns

Implements C5.IIndexed< T >.

void C5.GuardedIndexedSorted< T >.RemoveInterval ( int  start,
int  count 
)

Exceptions
ReadOnlyCollectionExceptionsince this is a read-only wrapper
Parameters
start
count

Implements C5.IIndexed< T >.

Property Documentation

virtual Speed C5.GuardedIndexedSorted< T >.IndexingSpeed
get

T C5.GuardedIndexedSorted< T >.this[int i]
get

The i'th item of the wrapped sorted collection

IDirectedCollectionValue<T> C5.GuardedIndexedSorted< T >.this[int start, int end]
get

A directed collection of the items in the indicated interval of the wrapped collection


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