Class CharArraySet
A simple class that stores System.Strings as char[]'s in a hash table. Note that this is not a general purpose class. For example, it cannot remove items from the set, nor does it resize its hash table to be smaller, etc. It is designed to be quick to test if a char[] is in the set without the necessity of converting it to a System.String first.
You must specify the required LuceneVersion compatibility when creating CharArraySet:
- As of 3.1, supplementary characters are properly lowercased.
Please note: This class implements System.Collections.Generic.ISet<> but does not behave like it should in all cases. The generic type is System.String, because you can add any object to it, that has a string representation (which is converted to a string). The add methods will use System.Object.ToString() and store the result using a char[] buffer. The same behavior have the Contains(String) methods. The GetEnumerator() returns an IEnumerator{char[]}
Inheritance
Inherited Members
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
[Serializable]
public class CharArraySet : ISet<string>, ICollection<string>, IEnumerable<string>, IEnumerable
Constructors
Name | Description |
---|---|
CharArraySet(LuceneVersion, ICollection<String>, Boolean) | Creates a set from a collection of objects. |
CharArraySet(LuceneVersion, Int32, Boolean) | Create set with enough capacity to hold |
Fields
Name | Description |
---|---|
EMPTY_SET |
Properties
Name | Description |
---|---|
Count | Gets the number of elements contained in the CharArraySet. |
IsReadOnly |
|
Methods
Name | Description |
---|---|
Add(ICharSequence) | Add this ICharSequence into the set |
Add(Char[]) | Add this char[] directly to the set.
If |
Add(Object) | Add the System.Object.ToString() representation of |
Add(String) | Add this System.String into the set |
Clear() | Clears all entries in this set. This method is supported for reusing, but not ICollection{string}.Remove(string). |
Contains(ICharSequence) |
|
Contains(Char[]) |
|
Contains(Char[], Int32, Int32) |
|
Contains(Object) |
|
Contains(String) |
|
ContainsAll(IEnumerable<String>) | Returns |
ContainsAll<T>(IEnumerable<T>) | Returns |
Copy<T>(LuceneVersion, ICollection<T>) | Returns a copy of the given set as a CharArraySet. If the given set is a CharArraySet the ignoreCase property will be preserved. Note: If you intend to create a copy of another CharArraySet where the LuceneVersion of the source set differs from its copy CharArraySet(LuceneVersion, ICollection<String>, Boolean) should be used instead. The Copy<T>(LuceneVersion, ICollection<T>) will preserve the LuceneVersion of the source set it is an instance of CharArraySet. |
CopyTo(String[], Int32) | Copies the entire CharArraySet to a one-dimensional string[] array, starting at the specified index of the target array. |
Equals(Object) | Compares the specified object with this set for equality. Returns
This implementation first checks if the specified object is this set; if so it
returns |
GetEnumerator() | Returns an System.Collections.IEnumerator for char[] instances in this set. |
GetHashCode() | Returns the hash code value for this set. The hash code of a set
is defined to be the sum of the hash codes of the elements in the
set, where the hash code of a |
IsProperSubsetOf(IEnumerable<String>) | Determines whether a CharArraySet object is a proper subset of the specified collection. |
IsProperSubsetOf<T>(IEnumerable<T>) | Determines whether a CharArraySet object is a proper subset of the specified collection. |
IsProperSupersetOf(IEnumerable<String>) | Determines whether a CharArraySet object is a proper superset of the specified collection. |
IsProperSupersetOf<T>(IEnumerable<T>) | Determines whether a CharArraySet object is a proper superset of the specified collection. |
IsSubsetOf(IEnumerable<String>) | Determines whether a CharArraySet object is a subset of the specified collection. |
IsSubsetOf<T>(IEnumerable<T>) | Determines whether a CharArraySet object is a subset of the specified collection. |
IsSupersetOf(IEnumerable<String>) | Determines whether a CharArraySet object is a superset of the specified collection. |
IsSupersetOf<T>(IEnumerable<T>) | Determines whether a CharArraySet object is a superset of the specified collection. |
Overlaps(IEnumerable<String>) | Determines whether the current CharArraySet object and a specified collection share common elements. |
Overlaps<T>(IEnumerable<T>) | Determines whether the current CharArraySet object and a specified collection share common elements. |
SetEquals(IEnumerable<String>) | Determines whether the current set and the specified collection contain the same elements. |
ToString() | Returns a string that represents the current object. (Inherited from System.Object.) |
UnionWith(IEnumerable<ICharSequence>) | Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both. |
UnionWith(IEnumerable<Char[]>) | Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both. |
UnionWith(IEnumerable<String>) | Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both. |
UnionWith<T>(IEnumerable<T>) | Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both. |
UnmodifiableSet(CharArraySet) | Returns an unmodifiable CharArraySet. This allows to provide unmodifiable views of internal sets for "read-only" use. |
Explicit Interface Implementations
Name | Description |
---|---|
ICollection<String>.Add(String) | LUCENENET specific for supporting System.Collections.Generic.ICollection<>. |
IEnumerable<String>.GetEnumerator() |