Class CollectionValueBase<T>
Base class for classes implementing ICollectionValue[T]
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Support.C5
Assembly: Lucene.Net.dll
Syntax
public abstract class CollectionValueBase<T> : EnumerableBase<T>, ICollectionValue<T>, IEnumerable<T>, IEnumerable, IShowable, IFormattable
Type Parameters
Name | Description |
---|---|
T |
Properties
| Improve this Doc View SourceActiveEvents
A flag bitmap of the events currently subscribed to by this collection.
Declaration
public virtual EventTypeEnum ActiveEvents { get; }
Property Value
Type | Description |
---|---|
EventTypeEnum |
Count
The number of items in this collection.
Declaration
public abstract int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
CountSpeed
The value is symbolic indicating the type of asymptotic complexity in terms of the size of this collection (worst-case or amortized as relevant).
Declaration
public abstract Speed CountSpeed { get; }
Property Value
Type | Description |
---|---|
Speed | A characterization of the speed of the property in this collection. |
IsEmpty
Check if collection is empty.
Declaration
public abstract bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean | True if empty |
ListenableEvents
Declaration
public virtual EventTypeEnum ListenableEvents { get; }
Property Value
Type | Description |
---|---|
EventTypeEnum |
Methods
| Improve this Doc View SourceAll(Func<T, Boolean>)
Check if all items in this collection satisfies a specific predicate.
Declaration
public virtual bool All(Func<T, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | predicate | A delegate (Func`2 with )
defining the predicate
|
Returns
Type | Description |
---|---|
System.Boolean | True if all items satisfies the predicate |
Apply(Action<T>)
Apply an single argument action, Action`1 to this enumerable
Declaration
public virtual void Apply(Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | action | The action delegate |
Choose()
Choose some item of this collection.
Declaration
public abstract T Choose()
Returns
Type | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
NoSuchItemException | if collection is empty. |
CopyTo(T[], Int32)
Copy the items of this collection to part of an array.
Declaration
public virtual void CopyTo(T[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The array to copy to. |
System.Int32 | index | The starting index. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | if
is not a valid index
into the array (i.e. negative or greater than the size of the array)
or the array does not have room for the items.
|
Exists(Func<T, Boolean>)
Check if there exists an item that satisfies a specific predicate in this collection.
Declaration
public virtual bool Exists(Func<T, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | predicate | A delegate (Func`2 with )
defining the predicate
|
Returns
Type | Description |
---|---|
System.Boolean | True if such an item exists |
Filter(Func<T, Boolean>)
Create an enumerable, enumerating the items of this collection that satisfies a certain condition.
Declaration
public virtual IEnumerable<T> Filter(Func<T, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | predicate | A delegate (Func`2 with )
defining the predicate
|
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | The filtered enumerable |
Find(Func<T, Boolean>, out T)
Check if there exists an item that satisfies a specific predicate in this collection and return the first one in enumeration order.
Declaration
public virtual bool Find(Func<T, bool> predicate, out T item)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | predicate | A delegate (Func`2 with ) defining the predicate
|
T | item |
Returns
Type | Description |
---|---|
System.Boolean | True is such an item exists |
raiseCollectionChanged()
Fire the CollectionChanged event
Declaration
protected virtual void raiseCollectionChanged()
raiseCollectionCleared(Boolean, Int32)
Fire the CollectionCleared event
Declaration
protected virtual void raiseCollectionCleared(bool full, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | full | |
System.Int32 | count |
raiseCollectionCleared(Boolean, Int32, Nullable<Int32>)
Fire the CollectionCleared event
Declaration
protected virtual void raiseCollectionCleared(bool full, int count, int? offset)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | full | |
System.Int32 | count | |
System.Nullable<System.Int32> | offset |
raiseForAdd(T)
Declaration
protected virtual void raiseForAdd(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
raiseForInsert(Int32, T)
Declaration
protected virtual void raiseForInsert(int i, T item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | i | |
T | item |
raiseForRemove(T)
Declaration
protected void raiseForRemove(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
raiseForRemove(T, Int32)
Declaration
protected void raiseForRemove(T item, int count)
Parameters
Type | Name | Description |
---|---|---|
T | item | |
System.Int32 | count |
raiseForRemoveAll(ICollectionValue<T>)
Declaration
protected virtual void raiseForRemoveAll(ICollectionValue<T> wasRemoved)
Parameters
Type | Name | Description |
---|---|---|
ICollectionValue<T> | wasRemoved |
raiseForRemoveAt(Int32, T)
Declaration
protected void raiseForRemoveAt(int index, T item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
T | item |
raiseForSetThis(Int32, T, T)
Declaration
protected virtual void raiseForSetThis(int index, T value, T item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | |
T | value | |
T | item |
raiseForUpdate(T, T)
Declaration
protected virtual void raiseForUpdate(T newitem, T olditem)
Parameters
Type | Name | Description |
---|---|---|
T | newitem | |
T | olditem |
raiseForUpdate(T, T, Int32)
Declaration
protected virtual void raiseForUpdate(T newitem, T olditem, int count)
Parameters
Type | Name | Description |
---|---|---|
T | newitem | |
T | olditem | |
System.Int32 | count |
raiseItemInserted(T, Int32)
Fire the ItemInserted event
Declaration
protected virtual void raiseItemInserted(T item, int index)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item that was added |
System.Int32 | index |
raiseItemRemovedAt(T, Int32)
Fire the ItemRemovedAt event
Declaration
protected virtual void raiseItemRemovedAt(T item, int index)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item that was removed |
System.Int32 | index |
raiseItemsAdded(T, Int32)
Fire the ItemsAdded event
Declaration
protected virtual void raiseItemsAdded(T item, int count)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item that was added |
System.Int32 | count |
raiseItemsRemoved(T, Int32)
Fire the ItemsRemoved event
Declaration
protected virtual void raiseItemsRemoved(T item, int count)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item that was removed |
System.Int32 | count |
Show(StringBuilder, ref Int32, IFormatProvider)
Declaration
public virtual bool Show(StringBuilder stringbuilder, ref int rest, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | stringbuilder | |
System.Int32 | rest | |
System.IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
System.Boolean |
ToArray()
Create an array with the items of this collection (in the same order as an enumerator would output them).
Declaration
public virtual T[] ToArray()
Returns
Type | Description |
---|---|
T[] | The array |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
ToString(String, IFormatProvider)
Declaration
public virtual string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | |
System.IFormatProvider | formatProvider |
Returns
Type | Description |
---|---|
System.String |
Events
| Improve this Doc View SourceCollectionChanged
The change event. Will be raised for every change operation on the collection.
Declaration
public virtual event CollectionChangedHandler<T> CollectionChanged
Event Type
Type | Description |
---|---|
CollectionChangedHandler<T> |
CollectionCleared
The clear event. Will be raised for every Clear operation on the collection.
Declaration
public virtual event CollectionClearedHandler<T> CollectionCleared
Event Type
Type | Description |
---|---|
CollectionClearedHandler<T> |
ItemInserted
The item added event. Will be raised for every individual addition to the collection.
Declaration
public virtual event ItemInsertedHandler<T> ItemInserted
Event Type
Type | Description |
---|---|
ItemInsertedHandler<T> |
ItemRemovedAt
The item removed event. Will be raised for every individual removal from the collection.
Declaration
public virtual event ItemRemovedAtHandler<T> ItemRemovedAt
Event Type
Type | Description |
---|---|
ItemRemovedAtHandler<T> |
ItemsAdded
The item added event. Will be raised for every individual addition to the collection.
Declaration
public virtual event ItemsAddedHandler<T> ItemsAdded
Event Type
Type | Description |
---|---|
ItemsAddedHandler<T> |
ItemsRemoved
The item removed event. Will be raised for every individual removal from the collection.
Declaration
public virtual event ItemsRemovedHandler<T> ItemsRemoved
Event Type
Type | Description |
---|---|
ItemsRemovedHandler<T> |