Interface ICollectionValue<T>
A generic collection that may be enumerated and can answer efficiently how many items it contains. Like
IEnumerable<T>
,
this interface does not prescribe any operations to initialize or update the
collection. The main usage for this interface is to be the return type of
query operations on generic collection.
Inherited Members
Namespace: Lucene.Net.Support.C5
Assembly: Lucene.Net.dll
Syntax
public interface 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
EventTypeEnum ActiveEvents { get; }
Property Value
Type | Description |
---|---|
EventTypeEnum |
Count
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of items in this collection |
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
Speed CountSpeed { get; }
Property Value
Type | Description |
---|---|
Speed | A characterization of the speed of the property in this collection. |
IsEmpty
Declaration
bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean | True if this collection is empty. |
ListenableEvents
A flag bitmap of the events subscribable to by this collection.
Declaration
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
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 a delegate to all items of this collection.
Declaration
void Apply(Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | action | The delegate to apply |
Choose()
Choose some item of this collection.
Implementations must assure that the item returned may be efficiently removed.
Implementors may decide to implement this method in a way such that repeated calls do not necessarily give the same result, i.e. so that the result of the following test is undetermined:
coll.Choose() == coll.Choose()
Declaration
T Choose()
Returns
Type | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
NoSuchItemException | if collection is empty. |
CopyTo(T[], Int32)
Copy the items of this collection to a contiguous part of an array.
Declaration
void CopyTo(T[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The array to copy to |
System.Int32 | index | The index at which to copy the first item |
Exists(Func<T, Boolean>)
Check if there exists an item that satisfies a specific predicate in this collection.
Declaration
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 is such an item exists |
Filter(Func<T, Boolean>)
Create an enumerable, enumerating the items of this collection that satisfies a certain condition.
Declaration
IEnumerable<T> Filter(Func<T, bool> filter)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | filter | The T->bool filter delegate defining the condition |
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
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 |
ToArray()
Create an array with the items of this collection (in the same order as an enumerator would output them).
Declaration
T[] ToArray()
Returns
Type | Description |
---|---|
T[] | The array |
Events
| Improve this Doc View SourceCollectionChanged
The change event. Will be raised for every change operation on the collection.
Declaration
event CollectionChangedHandler<T> CollectionChanged
Event Type
Type | Description |
---|---|
CollectionChangedHandler<T> |
CollectionCleared
The change event. Will be raised for every clear operation on the collection.
Declaration
event CollectionClearedHandler<T> CollectionCleared
Event Type
Type | Description |
---|---|
CollectionClearedHandler<T> |
ItemInserted
The item inserted event. Will be raised for every individual insertion to the collection.
Declaration
event ItemInsertedHandler<T> ItemInserted
Event Type
Type | Description |
---|---|
ItemInsertedHandler<T> |
ItemRemovedAt
The item removed at event. Will be raised for every individual removal at from the collection.
Declaration
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
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
event ItemsRemovedHandler<T> ItemsRemoved
Event Type
Type | Description |
---|---|
ItemsRemovedHandler<T> |