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

The type of a sorted collection with persistence More...

Inheritance diagram for C5.IPersistentSorted< T >:
C5.ISorted< T > C5.ISequenced< T > C5.ICollection< T > C5.IDirectedCollectionValue< T > C5.IExtensible< T > C5.ICollectionValue< T > C5.IDirectedEnumerable< T > C5.ICollectionValue< T > C5.IShowable C5.IShowable C5.TreeBag< T > C5.TreeSet< T >

Public Member Functions

ISorted< T > Snapshot ()
 Make a (read-only) snap shot of this collection. More...
 
- Public Member Functions inherited from C5.ISorted< T >
FindMin ()
 Find the current least item of this sorted collection. More...
 
DeleteMin ()
 Remove the least item from this sorted collection. More...
 
FindMax ()
 Find the current largest item of this sorted collection. More...
 
DeleteMax ()
 Remove the largest item from this sorted collection. More...
 
bool TryPredecessor (T item, out T res)
 Find the strict predecessor of item in the 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 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 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 strict predecessor in the sorted collection of a particular value, that is, the largest item in the collection less than the supplied value. More...
 
Successor (T item)
 Find the strict successor in the sorted collection of a particular value, that is, the least item in the collection greater than the supplied value. More...
 
WeakPredecessor (T item)
 Find the weak predecessor in the sorted collection of a particular value, that is, the largest item in the collection less than or equal to the supplied value. More...
 
WeakSuccessor (T item)
 Find the weak successor in the sorted collection of a particular value, that is, the least item in the collection greater than or equal to the supplied value. More...
 
bool Cut (IComparable< T > cutFunction, out T low, out bool lowIsValid, out T high, out bool highIsValid)
 Given a "cut" function from the items of the sorted collection to More...
 
IDirectedEnumerable< T > RangeFrom (T bot)
 Query this sorted collection for items greater than or equal to a supplied value. More...
 
IDirectedEnumerable< T > RangeFromTo (T bot, T top)
 Query this sorted collection for items between two supplied values. More...
 
IDirectedEnumerable< T > RangeTo (T top)
 Query this sorted collection for items less than a supplied value. More...
 
IDirectedCollectionValue< T > RangeAll ()
 Create a directed collection with the same items as this collection. More...
 
void AddSorted (SCG.IEnumerable< T > items)
 Add all the items from another collection with an enumeration order that is increasing in the items. More...
 
void RemoveRangeFrom (T low)
 Remove all items of this collection above or at a supplied threshold. More...
 
void RemoveRangeFromTo (T low, T hi)
 Remove all items of this collection between two supplied thresholds. More...
 
void RemoveRangeTo (T hi)
 Remove all items of this collection below a supplied threshold. More...
 
- Public Member Functions inherited from C5.ISequenced< T >
int GetSequencedHashCode ()
 The hashcode is defined as More...
 
bool SequencedEquals (ISequenced< T > otherCollection)
 Compare this sequenced collection to another one in sequence order. More...
 
- Public Member Functions inherited from C5.ICollection< T >
new bool Add (T item)
 Add an item to this collection if possible. If this collection has set semantics, the item will be added if not already in the collection. If bag semantics, the item will always be added. More...
 
new void CopyTo (T[] array, int index)
 Copy the items of this collection to a contiguous part of an array. More...
 
int GetUnsequencedHashCode ()
 The unordered collection hashcode is defined as the sum of More...
 
bool UnsequencedEquals (ICollection< T > otherCollection)
 Compare the contents of this collection to another one without regards to the sequence order. The comparison will use this collection's itemequalityComparer to compare individual items. More...
 
new bool Contains (T item)
 Check if this collection contains (an item equivalent to according to the itemequalityComparer) a particular value. More...
 
int ContainsCount (T item)
 Count the number of items of the collection equal to a particular value. Returns 0 if and only if the value is not in the collection. More...
 
ICollectionValue< T > UniqueItems ()
 
ICollectionValue< KeyValuePair< T, int > > ItemMultiplicities ()
 
bool ContainsAll (SCG.IEnumerable< T > items)
 Check whether this collection contains all the values in another collection. If this collection has bag semantics ( More...
 
bool Find (ref T item)
 Check if this collection contains an item equivalent according to the itemequalityComparer to a particular value. If so, return in the ref argument (a binary copy of) the actual value found. More...
 
bool FindOrAdd (ref T item)
 Check if this collection contains an item equivalent according to the itemequalityComparer to a particular value. If so, return in the ref argument (a binary copy of) the actual value found. Else, add the item to the collection. More...
 
bool Update (T item)
 Check if this collection contains an item equivalent according to the itemequalityComparer to a particular value. If so, update the item in the collection with a (binary copy of) the supplied value. If the collection has bag semantics, it depends on the value of DuplicatesByCounting if this updates all equivalent copies in the collection or just one. More...
 
bool Update (T item, out T olditem)
 Check if this collection contains an item equivalent according to the itemequalityComparer to a particular value. If so, update the item in the collection with a (binary copy of) the supplied value. If the collection has bag semantics, it depends on the value of DuplicatesByCounting if this updates all equivalent copies in the collection or just one. More...
 
bool UpdateOrAdd (T item)
 Check if this collection contains an item equivalent according to the itemequalityComparer to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection. More...
 
bool UpdateOrAdd (T item, out T olditem)
 Check if this collection contains an item equivalent according to the itemequalityComparer to a particular value. If so, update the item in the collection to with a binary copy of the supplied value; else add the value to the collection. More...
 
new bool Remove (T item)
 Remove a particular item from this collection. If the collection has bag semantics only one copy equivalent to the supplied item is removed. More...
 
bool Remove (T item, out T removeditem)
 Remove a particular item from this collection if found. If the collection has bag semantics only one copy equivalent to the supplied item is removed, which one is implementation dependent. If an item was removed, report a binary copy of the actual item removed in the argument. More...
 
void RemoveAllCopies (T item)
 Remove all items equivalent to a given value. More...
 
void RemoveAll (SCG.IEnumerable< T > items)
 Remove all items in another collection from this one. If this collection has bag semantics, take multiplicities into account. More...
 
new void Clear ()
 Remove all items from this collection. More...
 
void RetainAll (SCG.IEnumerable< T > items)
 Remove all items not in some other collection from this one. If this collection has bag semantics, take multiplicities into account. More...
 
- Public Member Functions inherited from C5.IExtensible< T >
void AddAll (SCG.IEnumerable< T > items)
 Add the elements from another collection with a more specialized item type to this collection. If this collection has set semantics, only items not already in the collection will be added. More...
 
bool Check ()
 Check the integrity of the internal data structures of this collection. This is only relevant for developers of the library More...
 
- Public Member Functions inherited from C5.ICollectionValue< T >
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...
 
- Public Member Functions inherited from C5.IDirectedCollectionValue< T >
new IDirectedCollectionValue< T > Backwards ()
 Create a collection containing the same items as this collection, but whose enumerator will enumerate the items backwards. The new collection will become invalid if the original is modified. Method typically used as in More...
 
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...
 

Additional Inherited Members

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

The type of a sorted collection with persistence

Member Function Documentation

ISorted<T> C5.IPersistentSorted< T >.Snapshot ( )

Make a (read-only) snap shot of this collection.

Returns
The snap shot.

Implemented in C5.TreeBag< T >, and C5.TreeSet< T >.


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