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

An advanced interface to operations on an array. The array is viewed as an T:C5.IList`1 of fixed size, and so all operations that would change the size of the array will be invalid (and throw T:C5.FixedSizeCollectionException More...

Inheritance diagram for C5.WrappedArray< T >:
C5.IList< T > C5.IIndexed< 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

Public Member Functions

 WrappedArray (T[] wrappedarray)
 
IList< T > FindAll (Func< T, bool > filter)
 
IList< V > Map< V > (Func< T, V > mapper)
 
IList< V > Map< V > (Func< T, V > mapper, SCG.IEqualityComparer< V > equalityComparer)
 
void Insert (int index, T item)
 
void Insert (IList< T > pointer, T item)
 
void InsertFirst (T item)
 
void InsertLast (T item)
 
void InsertAll (int i, System.Collections.Generic.IEnumerable< T > items)
 
Remove ()
 
RemoveFirst ()
 
RemoveLast ()
 
IList< T > View (int start, int count)
 
IList< T > ViewOf (T item)
 
IList< T > LastViewOf (T item)
 
IList< T > Slide (int offset)
 
IList< T > Slide (int offset, int size)
 
bool TrySlide (int offset)
 
bool TrySlide (int offset, int size)
 
IList< T > Span (IList< T > otherView)
 
void Reverse ()
 
bool IsSorted ()
 
bool IsSorted (SCG.IComparer< T > comparer)
 
void Sort ()
 
void Sort (SCG.IComparer< T > comparer)
 
void Shuffle ()
 
void Shuffle (Random rnd)
 
int IndexOf (T item)
 
int LastIndexOf (T item)
 
int FindIndex (Func< T, bool > predicate)
 
int FindLastIndex (Func< T, bool > predicate)
 
RemoveAt (int i)
 
void RemoveInterval (int start, int count)
 
int GetSequencedHashCode ()
 
bool SequencedEquals (ISequenced< T > that)
 
int GetUnsequencedHashCode ()
 
bool UnsequencedEquals (ICollection< T > that)
 
bool Contains (T item)
 
int ContainsCount (T item)
 
ICollectionValue< T > UniqueItems ()
 
ICollectionValue< KeyValuePair< T, int > > ItemMultiplicities ()
 
bool ContainsAll (System.Collections.Generic.IEnumerable< T > items)
 
bool Find (ref T item)
 
bool FindOrAdd (ref T item)
 
bool Update (T item)
 
bool Update (T item, out T olditem)
 
bool UpdateOrAdd (T item)
 
bool UpdateOrAdd (T item, out T olditem)
 
bool Remove (T item)
 
bool Remove (T item, out T removeditem)
 
void RemoveAllCopies (T item)
 
void RemoveAll (System.Collections.Generic.IEnumerable< T > items)
 
void Clear ()
 
void RetainAll (System.Collections.Generic.IEnumerable< T > items)
 
bool Add (T item)
 
void AddAll (System.Collections.Generic.IEnumerable< T > items)
 
bool Check ()
 
void CopyTo (T[] array, int index)
 
T[] ToArray ()
 
void Apply (Action< T > action)
 
bool Exists (Func< T, bool > predicate)
 
bool Find (Func< T, bool > predicate, out T item)
 
bool All (Func< T, bool > predicate)
 
Choose ()
 
SCG.IEnumerable< T > Filter (Func< T, bool > filter)
 
SCG.IEnumerator< T > GetEnumerator ()
 
bool Show (StringBuilder stringbuilder, ref int rest, IFormatProvider formatProvider)
 
override string ToString ()
 
virtual string ToString (string format, IFormatProvider formatProvider)
 
IDirectedCollectionValue< T > Backwards ()
 
bool FindLast (Func< T, bool > predicate, out T item)
 
void Dispose ()
 Dispose this if a view else operation is illegal More...
 

Properties

First [get]
 
Last [get]
 
this[int index] [get, set]
 
bool FIFO [get, set]
 ???? should we throw NotRelevantException More...
 
virtual bool IsFixedSize [get]
 
IList< T > Underlying [get]
 
int Offset [get]
 
bool IsValid [get]
 
Speed IndexingSpeed [get]
 
IDirectedCollectionValue< T > this[int start, int count] [get]
 
Speed ContainsSpeed [get]
 
bool IsReadOnly [get]
 
bool AllowsDuplicates [get]
 
SCG.IEqualityComparer< T > EqualityComparer [get]
 
bool DuplicatesByCounting [get]
 
virtual EventTypeEnum ListenableEvents [get]
 No listeners may be installed More...
 
virtual EventTypeEnum ActiveEvents [get]
 No listeners ever installed More...
 
CollectionChangedHandler< T > CollectionChanged
 
CollectionClearedHandler< T > CollectionCleared
 
ItemsAddedHandler< T > ItemsAdded
 
ItemInsertedHandler< T > ItemInserted
 
ItemsRemovedHandler< T > ItemsRemoved
 
ItemRemovedAtHandler< T > ItemRemovedAt
 
bool IsEmpty [get]
 
int Count [get]
 
Speed CountSpeed [get]
 
EnumerationDirection Direction [get]
 
- Properties inherited from C5.IList< T >
First [get]
 
Last [get]
 
bool FIFO [get, set]
 Since More...
 
bool IsFixedSize [get]
 
new T this[int index] [get, set]
 On this list, this indexer is read/write. More...
 
new int Count [get]
 
new bool IsReadOnly [get]
 
IList< T > Underlying [get]
 Null if this list is not a view. More...
 
int Offset [get]
 
bool IsValid [get]
 
- Properties inherited from C5.IIndexed< T >
Speed IndexingSpeed [get]
 
IDirectedCollectionValue< T > this[int start, int count] [get]
 
- 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]
 

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

An advanced interface to operations on an array. The array is viewed as an T:C5.IList`1 of fixed size, and so all operations that would change the size of the array will be invalid (and throw T:C5.FixedSizeCollectionException

Template Parameters
T

Constructor & Destructor Documentation

C5.WrappedArray< T >.WrappedArray ( T[]  wrappedarray)

Parameters
wrappedarray

Member Function Documentation

bool C5.WrappedArray< T >.Add ( item)

Parameters
item
Returns

Implements C5.IList< T >.

void C5.WrappedArray< T >.AddAll ( System.Collections.Generic.IEnumerable< T >  items)

Parameters
items

Implements C5.IExtensible< T >.

bool C5.WrappedArray< T >.All ( Func< T, bool >  predicate)

Parameters
predicate
Returns

Implements C5.ICollectionValue< T >.

void C5.WrappedArray< T >.Apply ( Action< T >  action)

Parameters
action

Implements C5.ICollectionValue< T >.

bool C5.WrappedArray< T >.Check ( )

Returns

Implements C5.IExtensible< T >.

T C5.WrappedArray< T >.Choose ( )

Returns

Implements C5.ICollectionValue< T >.

void C5.WrappedArray< T >.Clear ( )

Implements C5.IList< T >.

bool C5.WrappedArray< T >.Contains ( item)

Parameters
item
Returns

Implements C5.IList< T >.

bool C5.WrappedArray< T >.ContainsAll ( System.Collections.Generic.IEnumerable< T >  items)

Parameters
items
Returns

Implements C5.ICollection< T >.

int C5.WrappedArray< T >.ContainsCount ( item)

Parameters
item
Returns

Implements C5.ICollection< T >.

void C5.WrappedArray< T >.CopyTo ( T[]  array,
int  index 
)

Parameters
array
index

Implements C5.IList< T >.

void C5.WrappedArray< T >.Dispose ( )

Dispose this if a view else operation is illegal

Exceptions
FixedSizeCollectionExceptionIf not a view
bool C5.WrappedArray< T >.Exists ( Func< T, bool >  predicate)

Parameters
predicate
Returns

Implements C5.ICollectionValue< T >.

SCG.IEnumerable<T> C5.WrappedArray< T >.Filter ( Func< T, bool >  filter)

Parameters
filter
Returns

Implements C5.ICollectionValue< T >.

bool C5.WrappedArray< T >.Find ( ref T  item)

Parameters
item
Returns

Implements C5.ICollection< T >.

bool C5.WrappedArray< T >.Find ( Func< T, bool >  predicate,
out T  item 
)

Parameters
predicate
item
Returns

Implements C5.ICollectionValue< T >.

IList<T> C5.WrappedArray< T >.FindAll ( Func< T, bool >  filter)

Parameters
filter
Returns

Implements C5.IList< T >.

int C5.WrappedArray< T >.FindIndex ( Func< T, bool >  predicate)

Parameters
predicate
Returns

Implements C5.IIndexed< T >.

bool C5.WrappedArray< T >.FindLast ( Func< T, bool >  predicate,
out T  item 
)

Parameters
predicate
item
Returns

Implements C5.IDirectedCollectionValue< T >.

int C5.WrappedArray< T >.FindLastIndex ( Func< T, bool >  predicate)

Parameters
predicate
Returns

Implements C5.IIndexed< T >.

bool C5.WrappedArray< T >.FindOrAdd ( ref T  item)

Parameters
item
Returns

Implements C5.ICollection< T >.

SCG.IEnumerator<T> C5.WrappedArray< T >.GetEnumerator ( )

Returns
int C5.WrappedArray< T >.GetSequencedHashCode ( )

Returns

Implements C5.ISequenced< T >.

int C5.WrappedArray< T >.GetUnsequencedHashCode ( )

Returns

Implements C5.ICollection< T >.

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

Parameters
item
Returns

Implements C5.IList< T >.

void C5.WrappedArray< T >.Insert ( int  index,
item 
)

Parameters
index
item
void C5.WrappedArray< T >.Insert ( IList< T >  pointer,
item 
)

Parameters
pointer
item

Implements C5.IList< T >.

void C5.WrappedArray< T >.InsertAll ( int  i,
System.Collections.Generic.IEnumerable< T >  items 
)

Parameters
i
items

Implements C5.IList< T >.

void C5.WrappedArray< T >.InsertFirst ( item)

Parameters
item

Implements C5.IList< T >.

void C5.WrappedArray< T >.InsertLast ( item)

Parameters
item

Implements C5.IList< T >.

bool C5.WrappedArray< T >.IsSorted ( )

Returns

Implements C5.IList< T >.

bool C5.WrappedArray< T >.IsSorted ( SCG.IComparer< T >  comparer)

Parameters
comparer
Returns

Implements C5.IList< T >.

ICollectionValue<KeyValuePair<T, int> > C5.WrappedArray< T >.ItemMultiplicities ( )

Returns

Implements C5.ICollection< T >.

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

Parameters
item
Returns

Implements C5.IIndexed< T >.

IList<T> C5.WrappedArray< T >.LastViewOf ( item)

Parameters
item
Returns

Implements C5.IList< T >.

IList<V> C5.WrappedArray< T >.Map< V > ( Func< T, V >  mapper)

Template Parameters
V
Parameters
mapper
Returns

Implements C5.IList< T >.

IList<V> C5.WrappedArray< T >.Map< V > ( Func< T, V >  mapper,
SCG.IEqualityComparer< V >  equalityComparer 
)

Template Parameters
V
Parameters
mapper
equalityComparer
Returns

Implements C5.IList< T >.

T C5.WrappedArray< T >.Remove ( )

Returns

Implements C5.IList< T >.

bool C5.WrappedArray< T >.Remove ( item)

Parameters
item
Returns

Implements C5.IList< T >.

bool C5.WrappedArray< T >.Remove ( item,
out T  removeditem 
)

Parameters
item
removeditem
Returns

Implements C5.ICollection< T >.

void C5.WrappedArray< T >.RemoveAll ( System.Collections.Generic.IEnumerable< T >  items)

Parameters
items

Implements C5.ICollection< T >.

void C5.WrappedArray< T >.RemoveAllCopies ( item)

Parameters
item

Implements C5.ICollection< T >.

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

Parameters
i
Returns

Implements C5.IList< T >.

T C5.WrappedArray< T >.RemoveFirst ( )

Returns

Implements C5.IList< T >.

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

Parameters
start
count

Implements C5.IIndexed< T >.

T C5.WrappedArray< T >.RemoveLast ( )

Returns

Implements C5.IList< T >.

void C5.WrappedArray< T >.RetainAll ( System.Collections.Generic.IEnumerable< T >  items)

Parameters
items

Implements C5.ICollection< T >.

void C5.WrappedArray< T >.Reverse ( )

Implements C5.IList< T >.

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

Parameters
that
Returns

Implements C5.ISequenced< T >.

bool C5.WrappedArray< T >.Show ( StringBuilder  stringbuilder,
ref int  rest,
IFormatProvider  formatProvider 
)

Parameters
stringbuilder
rest
formatProvider
Returns

Implements C5.IShowable.

void C5.WrappedArray< T >.Shuffle ( )

Implements C5.IList< T >.

void C5.WrappedArray< T >.Shuffle ( Random  rnd)

Parameters
rnd

Implements C5.IList< T >.

IList<T> C5.WrappedArray< T >.Slide ( int  offset)

Parameters
offset
Returns

Implements C5.IList< T >.

IList<T> C5.WrappedArray< T >.Slide ( int  offset,
int  size 
)

Parameters
offset
size
Returns

Implements C5.IList< T >.

void C5.WrappedArray< T >.Sort ( )

Implements C5.IList< T >.

void C5.WrappedArray< T >.Sort ( SCG.IComparer< T >  comparer)

Parameters
comparer

Implements C5.IList< T >.

IList<T> C5.WrappedArray< T >.Span ( IList< T >  otherView)

Parameters
otherView
Returns

Implements C5.IList< T >.

T [] C5.WrappedArray< T >.ToArray ( )

Returns

Implements C5.ICollectionValue< T >.

override string C5.WrappedArray< T >.ToString ( )

Returns
virtual string C5.WrappedArray< T >.ToString ( string  format,
IFormatProvider  formatProvider 
)
virtual

Parameters
format
formatProvider
Returns
bool C5.WrappedArray< T >.TrySlide ( int  offset)

Parameters
offset
Returns

Implements C5.IList< T >.

bool C5.WrappedArray< T >.TrySlide ( int  offset,
int  size 
)

Parameters
offset
size
Returns

Implements C5.IList< T >.

ICollectionValue<T> C5.WrappedArray< T >.UniqueItems ( )

Returns

Implements C5.ICollection< T >.

bool C5.WrappedArray< T >.UnsequencedEquals ( ICollection< T >  that)

Parameters
that
Returns

Implements C5.ICollection< T >.

bool C5.WrappedArray< T >.Update ( item)

Parameters
item
Returns

Implements C5.ICollection< T >.

bool C5.WrappedArray< T >.Update ( item,
out T  olditem 
)

Parameters
item
olditem
Returns

Implements C5.ICollection< T >.

bool C5.WrappedArray< T >.UpdateOrAdd ( item)

Parameters
item
Returns

Implements C5.ICollection< T >.

bool C5.WrappedArray< T >.UpdateOrAdd ( item,
out T  olditem 
)

Parameters
item
olditem
Returns

Implements C5.ICollection< T >.

IList<T> C5.WrappedArray< T >.View ( int  start,
int  count 
)

Parameters
start
count
Returns

Implements C5.IList< T >.

IList<T> C5.WrappedArray< T >.ViewOf ( item)

Parameters
item
Returns

Implements C5.IList< T >.

Property Documentation

virtual EventTypeEnum C5.WrappedArray< T >.ActiveEvents
get

No listeners ever installed

0

bool C5.WrappedArray< T >.AllowsDuplicates
get

CollectionChangedHandler<T> C5.WrappedArray< T >.CollectionChanged
addremove

CollectionClearedHandler<T> C5.WrappedArray< T >.CollectionCleared
addremove

Speed C5.WrappedArray< T >.ContainsSpeed
get

int C5.WrappedArray< T >.Count
get

Speed C5.WrappedArray< T >.CountSpeed
get

bool C5.WrappedArray< T >.DuplicatesByCounting
get

SCG.IEqualityComparer<T> C5.WrappedArray< T >.EqualityComparer
get

bool C5.WrappedArray< T >.FIFO
getset

???? should we throw NotRelevantException

T C5.WrappedArray< T >.First
get

Speed C5.WrappedArray< T >.IndexingSpeed
get

bool C5.WrappedArray< T >.IsEmpty
get

virtual bool C5.WrappedArray< T >.IsFixedSize
get

bool C5.WrappedArray< T >.IsReadOnly
get

bool C5.WrappedArray< T >.IsValid
get

ItemInsertedHandler<T> C5.WrappedArray< T >.ItemInserted
addremove

ItemRemovedAtHandler<T> C5.WrappedArray< T >.ItemRemovedAt
addremove

ItemsAddedHandler<T> C5.WrappedArray< T >.ItemsAdded
addremove

ItemsRemovedHandler<T> C5.WrappedArray< T >.ItemsRemoved
addremove

T C5.WrappedArray< T >.Last
get

virtual EventTypeEnum C5.WrappedArray< T >.ListenableEvents
get

No listeners may be installed

0

int C5.WrappedArray< T >.Offset
get

T C5.WrappedArray< T >.this[int index]
getset

Parameters
index
Returns
IDirectedCollectionValue<T> C5.WrappedArray< T >.this[int start, int count]
get

Parameters
start
count
Returns
IList<T> C5.WrappedArray< T >.Underlying
get


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