Class GuardedSorted<T>

A read-only wrapper for a sorted collection This is mainly interesting as a base of other guard classes

Implements

IEnumerable<T>, System.Collections.IEnumerable, System.IFormattable, System.ICloneable, System.Collections.Generic.ICollection<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, ISequenced<T>, IShowable, ISorted<T>

Bases

object, GuardedEnumerable<T>, GuardedCollectionValue<T>, GuardedCollection<T>, GuardedSequenced<T>

Base of

GuardedIndexedSorted<T>

Event overview

CollectionChanged, Inherited from GuardedCollectionValue<T> ,
CollectionCleared, Inherited from GuardedCollectionValue<T> ,
ItemInserted, Inherited from GuardedCollectionValue<T> ,
ItemRemovedAt, Inherited from GuardedCollectionValue<T> ,
ItemsAdded, Inherited from GuardedCollectionValue<T> ,
ItemsRemoved, Inherited from GuardedCollectionValue<T>

Property overview

ActiveEvents, Inherited from GuardedCollectionValue<T> ,
AllowsDuplicates, Inherited from GuardedCollection<T> ,
Comparer ,
ContainsSpeed, Inherited from GuardedCollection<T> ,
Count, Inherited from GuardedCollectionValue<T> ,
CountSpeed, Inherited from GuardedCollectionValue<T> ,
Direction, Inherited from GuardedSequenced<T> ,
DuplicatesByCounting, Inherited from GuardedCollection<T> ,
EqualityComparer, Inherited from GuardedCollection<T> ,
IsEmpty, Inherited from GuardedCollection<T> ,
IsReadOnly, Inherited from GuardedCollection<T> ,
ListenableEvents, Inherited from GuardedCollectionValue<T>

Constructor overview

GuardedSorted<T>(ISorted<T> sorted)

Method overview

Add(T item), Inherited from GuardedCollection<T> ,
AddAll<U>(IEnumerable<U> items), Inherited from GuardedCollection<T> ,
AddSorted<U>(IEnumerable<U> items) ,
All(Fun<T,bool> filter), Inherited from GuardedCollectionValue<T> ,
Apply(Act<T> a), Inherited from GuardedCollectionValue<T> ,
Backwards(), Inherited from GuardedSequenced<T> ,
Check(), Inherited from GuardedCollection<T> ,
Choose(), Inherited from GuardedCollectionValue<T> ,
Clear(), Inherited from GuardedCollection<T> ,
Clone() ,
Contains(T item), Inherited from GuardedCollection<T> ,
ContainsAll<U>(IEnumerable<U> items), Inherited from GuardedCollection<T> ,
ContainsCount(T item), Inherited from GuardedCollection<T> ,
CopyTo(T[] a, int i), Inherited from GuardedCollectionValue<T> ,
Cut(System.IComparable<T> c, out T low, out bool lval, out T high, out bool hval) ,
DeleteMax() ,
DeleteMin() ,
Equals(object obj), Inherited from object ,
Exists(Fun<T,bool> filter), Inherited from GuardedCollectionValue<T> ,
Filter(Fun<T,bool> filter), Inherited from GuardedCollectionValue<T> ,
Finalize(), Inherited from object ,
Find(ref T item), Inherited from GuardedCollection<T> ,
Find(Fun<T,bool> filter, out T item), Inherited from GuardedCollectionValue<T> ,
FindIndex(Fun<T,bool> predicate), Inherited from GuardedSequenced<T> ,
FindLast(Fun<T,bool> predicate, out T item), Inherited from GuardedSequenced<T> ,
FindLastIndex(Fun<T,bool> predicate), Inherited from GuardedSequenced<T> ,
FindMax() ,
FindMin() ,
FindOrAdd(ref T item), Inherited from GuardedCollection<T> ,
GetEnumerator(), Inherited from GuardedEnumerable<T> ,
GetHashCode(), Inherited from object ,
GetSequencedHashCode(), Inherited from GuardedSequenced<T> ,
GetType(), Inherited from object ,
GetUnsequencedHashCode(), Inherited from GuardedCollection<T> ,
ItemMultiplicities(), Inherited from GuardedCollection<T> ,
MemberwiseClone(), Inherited from object ,
Predecessor(T item) ,
RangeAll() ,
RangeFrom(T bot) ,
RangeFromTo(T bot, T top) ,
RangeTo(T top) ,
Remove(T item), Inherited from GuardedCollection<T> ,
Remove(T item, out T removeditem), Inherited from GuardedCollection<T> ,
RemoveAll<U>(IEnumerable<U> items), Inherited from GuardedCollection<T> ,
RemoveAllCopies(T item), Inherited from GuardedCollection<T> ,
RemoveRangeFrom(T low) ,
RemoveRangeFromTo(T low, T hi) ,
RemoveRangeTo(T hi) ,
RetainAll<U>(IEnumerable<U> items), Inherited from GuardedCollection<T> ,
SequencedEquals(ISequenced<T> that), Inherited from GuardedSequenced<T> ,
Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider), Inherited from GuardedCollectionValue<T> ,
Successor(T item) ,
ToArray(), Inherited from GuardedCollectionValue<T> ,
ToString(string format, System.IFormatProvider formatProvider), Inherited from GuardedCollectionValue<T> ,
ToString(), Inherited from object ,
TryPredecessor(T item, out T res) ,
TrySuccessor(T item, out T res) ,
TryWeakPredecessor(T item, out T res) ,
TryWeakSuccessor(T item, out T res) ,
UniqueItems(), Inherited from GuardedCollection<T> ,
UnsequencedEquals(ICollection<T> that), Inherited from GuardedCollection<T> ,
Update(T item), Inherited from GuardedCollection<T> ,
Update(T item, out T olditem), Inherited from GuardedCollection<T> ,
UpdateOrAdd(T item), Inherited from GuardedCollection<T> ,
UpdateOrAdd(T item, out T olditem), Inherited from GuardedCollection<T> ,
WeakPredecessor(T item) ,
WeakSuccessor(T item)

Property details

F System.Collections.Generic.IComparer<T> ComparerAccess: Read-Only

Value:The comparer

The comparer object supplied at creation time for the underlying collection

Constructor details

GuardedSorted<T>(ISorted<T> sorted) Wrap a sorted collection in a read-only wrapper
Parameters:
sorted:

Method details

F void AddSorted<U>(IEnumerable<U> items)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Type parameters:
U
Constraints:
U : T
Parameters:
items:
object Clone()
Returns:
F bool Cut(System.IComparable<T> c, out T low, out bool lval, out T high, out bool hval) Run Cut on the wrapped sorted collection
Returns:
Parameters:
c:
low:
lval:
high:
hval:
F T DeleteMax()
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
F T DeleteMin()
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Returns:
F T FindMax() Find the maximum of the wrapped collection
Returns:The maximum
F T FindMin() Find the minimum of the wrapped collection
Returns:The minimum
F T Predecessor(T item) Find the predecessor of the item in the wrapped sorted collection
Throws
NoSuchItemException if no such element exists
Returns:The predecessor
Parameters:
item:The item
F IDirectedCollectionValue<T> RangeAll() Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
F IDirectedEnumerable<T> RangeFrom(T bot) Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
Parameters:
bot:
F IDirectedEnumerable<T> RangeFromTo(T bot, T top) Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
Parameters:
bot:
top:
F IDirectedEnumerable<T> RangeTo(T top) Get the specified range from the wrapped collection. (The current implementation erroneously does not wrap the result.)
Returns:
Parameters:
top:
F void RemoveRangeFrom(T low)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Parameters:
low:
F void RemoveRangeFromTo(T low, T hi)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Parameters:
low:
hi:
F void RemoveRangeTo(T hi)
Throws
ReadOnlyCollectionException since this is a read-only wrappper
Parameters:
hi:
F T Successor(T item) Find the Successor of the item in the wrapped sorted collection
Throws
NoSuchItemException if no such element exists
Returns:The Successor
Parameters:
item:The item
F 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.
Returns:True if item has a predecessor; otherwise false.
Parameters:
item:The item to find the predecessor for.
res:The predecessor, if any; otherwise the default value for T.
F 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.
Returns:True if item has a successor; otherwise false.
Parameters:
item:The item to find the successor for.
res:The successor, if any; otherwise the default value for T.
F 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.
Returns:True if item has a weak predecessor; otherwise false.
Parameters:
item:The item to find the weak predecessor for.
res:The weak predecessor, if any; otherwise the default value for T.
F 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.
Returns:True if item has a weak successor; otherwise false.
Parameters:
item:The item to find the weak successor for.
res:The weak successor, if any; otherwise the default value for T.
F T WeakPredecessor(T item) Find the weak predecessor of the item in the wrapped sorted collection
Throws
NoSuchItemException if no such element exists
Returns:The weak predecessor
Parameters:
item:The item
F T WeakSuccessor(T item) Find the weak Successor of the item in the wrapped sorted collection
Throws
NoSuchItemException if no such element exists
Returns:The weak Successor
Parameters:
item:The item