Class CollectionBase<T>
Base class (abstract) for ICollection implementations.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Support.C5
Assembly: Lucene.Net.dll
Syntax
public abstract class CollectionBase<T> : CollectionValueBase<T>, ICollectionValue<T>, IEnumerable<T>, IEnumerable, IShowable, IFormattable
  Type Parameters
| Name | Description | 
|---|---|
| T | 
Constructors
| Improve this Doc View SourceCollectionBase(IEqualityComparer<T>, MemoryType)
Declaration
protected CollectionBase(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  | 
      
Fields
| Improve this Doc View SourceisReadOnlyBase
The underlying field of the ReadOnly property
Declaration
protected bool isReadOnlyBase
  Field Value
| Type | Description | 
|---|---|
| System.Boolean | 
itemequalityComparer
The item equalityComparer of the collection
Declaration
protected readonly IEqualityComparer<T> itemequalityComparer
  Field Value
| Type | Description | 
|---|---|
| System.Collections.Generic.IEqualityComparer<T> | 
size
The number of items in the collection
Declaration
protected int size
  Field Value
| Type | Description | 
|---|---|
| System.Int32 | 
Properties
| Improve this Doc View SourceCount
Declaration
public override int Count { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | The size of this collection  | 
      
Overrides
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 override Speed CountSpeed { get; }
  Property Value
| Type | Description | 
|---|---|
| Speed | A characterization of the speed of the  property in this collection. | 
      
Overrides
EqualityComparer
Declaration
public virtual IEqualityComparer<T> EqualityComparer { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Collections.Generic.IEqualityComparer<T> | 
IsEmpty
Declaration
public override bool IsEmpty { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | True if this collection is empty  | 
      
Overrides
IsReadOnly
Declaration
public virtual bool IsReadOnly { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | True if this collection is read only  | 
      
stamp
The current stamp value
Declaration
protected int stamp { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Methods
| Improve this Doc View SourcecheckRange(Int32, Int32)
Utility method for range checking.
Declaration
protected void checkRange(int start, int count)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | start | start of range  | 
      
| System.Int32 | count | size of range  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentOutOfRangeException | if the start or count is negative or if the range does not fit within collection size.  | 
      
ComputeHashCode(ICollectionValue<T>, IEqualityComparer<T>)
Compute the unsequenced hash code of a collection
Declaration
public static int ComputeHashCode(ICollectionValue<T> items, IEqualityComparer<T> itemequalityComparer)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ICollectionValue<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  | 
      
GetUnsequencedHashCode()
Get the unsequenced collection hash code of this collection: from the cached value if present and up to date, else (re)compute.
Declaration
public virtual int GetUnsequencedHashCode()
  Returns
| Type | Description | 
|---|---|
| System.Int32 | The hash code  | 
      
modifycheck(Int32)
Check if the collection has been modified since a specified time, expressed as a stamp value.
Declaration
protected virtual void modifycheck(int thestamp)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | thestamp | The stamp identifying the target time  | 
      
Exceptions
| Type | Condition | 
|---|---|
| CollectionModifiedException | if this collection has been updated since a target time  | 
      
StaticEquals(ICollection<T>, ICollection<T>, IEqualityComparer<T>)
Examine if collection1 and collection2 are equal as unsequenced collections using the specified item equalityComparer (assumed compatible with the two collections).
Declaration
public static bool StaticEquals(ICollection<T> collection1, ICollection<T> collection2, IEqualityComparer<T> itemequalityComparer)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ICollection<T> | collection1 | The first collection  | 
      
| ICollection<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  | 
      
UnsequencedEquals(ICollection<T>)
Check if the contents of otherCollection is equal to the contents of this in the unsequenced sense. Uses the item equality comparer of this collection
Declaration
public virtual bool UnsequencedEquals(ICollection<T> otherCollection)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ICollection<T> | otherCollection | The collection to compare to.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Boolean | True if equal  | 
      
updatecheck()
Check if it is valid to perform update operations, and if so increment stamp.
Declaration
protected virtual void updatecheck()
  Exceptions
| Type | Condition | 
|---|---|
| ReadOnlyCollectionException | If collection is read-only  |