Class HashRangeCollection
Represents a collection of non-overlapping hash ranges.
Inheritance
System.Object
HashRangeCollection
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ConsistentHashing
Assembly: ConsistentHashing.dll
Syntax
public class HashRangeCollection : IEnumerable<HashRange>, IEnumerable
Constructors
| Improve this Doc View SourceHashRangeCollection(IEnumerable<HashRange>)
Create a collection of hash ranges. The ranges must be non-overlapping.
Declaration
public HashRangeCollection(IEnumerable<HashRange> ranges)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<HashRange> | ranges | The hash ranges. |
Methods
| Improve this Doc View SourceContains(UInt32)
Checks whether the specified hash falls within any range in the collection.
Declaration
public bool Contains(uint hash)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | hash | The hash to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the hash is within a range in the collection and false otherwise. |
GetEnumerator()
Returns an enumerator that iterates over all the HashRanges in the collection.
Declaration
public IEnumerator<HashRange> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<HashRange> | The enumerator. |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable