Class SequencedBase<T>
Base class (abstract) for sequenced collection implementations.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Support.C5
Assembly: Lucene.Net.dll
Syntax
public abstract class SequencedBase<T> : DirectedCollectionBase<T>, IDirectedCollectionValue<T>, ICollectionValue<T>, IShowable, IFormattable, IDirectedEnumerable<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T |
Constructors
| Improve this Doc View SourceSequencedBase(IEqualityComparer<T>, MemoryType)
Declaration
protected SequencedBase(IEqualityComparer<T> itemequalityComparer, MemoryType memoryType)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEqualityComparer<T> | itemequalityComparer | |
MemoryType | memoryType | The type of memory for the enumerator used to iterate the collection |
Properties
| Improve this Doc View SourceDirection
Forwards
if same, else Backwards
Declaration
public override EnumerationDirection Direction { get; }
Property Value
Type | Description |
---|---|
EnumerationDirection | The enumeration direction relative to the original collection. |
Overrides
Methods
| Improve this Doc View SourceComputeHashCode(ISequenced<T>, IEqualityComparer<T>)
Compute the unsequenced hash code of a collection
Declaration
public static int ComputeHashCode(ISequenced<T> items, IEqualityComparer<T> itemequalityComparer)
Parameters
Type | Name | Description |
---|---|---|
ISequenced<T> | items | The collection to compute hash code for |
System.Collections.Generic.IEqualityComparer<T> | itemequalityComparer | The item equalitySCG.Comparer |
Returns
Type | Description |
---|---|
System.Int32 | The hash code |
FindIndex(Func<T, Boolean>)
Check if there exists an item that satisfies a specific predicate in this collection and return the index of the first one.
Declaration
public int FindIndex(Func<T, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | predicate | A delegate defining the predicate |
Returns
Type | Description |
---|---|
System.Int32 | the index, if found, a negative value else |
FindLastIndex(Func<T, Boolean>)
Check if there exists an item that satisfies a specific predicate in this collection and return the index of the last one.
Declaration
public int FindLastIndex(Func<T, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | predicate | A delegate defining the predicate |
Returns
Type | Description |
---|---|
System.Int32 | the index, if found, a negative value else |
GetSequencedHashCode()
Get the sequenced collection hash code of this collection: from the cached value if present and up to date, else (re)compute.
Declaration
public virtual int GetSequencedHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code |
SequencedEquals(ISequenced<T>)
Check if the contents of that is equal to the contents of this in the sequenced sense. Using the item equalityComparer of this collection.
Declaration
public virtual bool SequencedEquals(ISequenced<T> otherCollection)
Parameters
Type | Name | Description |
---|---|---|
ISequenced<T> | otherCollection | The collection to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if equal |
StaticEquals(ISequenced<T>, ISequenced<T>, IEqualityComparer<T>)
Examine if tit and tat are equal as sequenced collections using the specified item equalityComparer (assumed compatible with the two collections).
Declaration
public static bool StaticEquals(ISequenced<T> collection1, ISequenced<T> collection2, IEqualityComparer<T> itemequalityComparer)
Parameters
Type | Name | Description |
---|---|---|
ISequenced<T> | collection1 | The first collection |
ISequenced<T> | collection2 | The second collection |
System.Collections.Generic.IEqualityComparer<T> | itemequalityComparer | The item equalityComparer to use for comparison |
Returns
Type | Description |
---|---|
System.Boolean | True if equal |