Class CharArraySet
A simple class that stores
You must specify the required LuceneVersion compatibility when creating CharArraySet:
- As of 3.1, supplementary characters are properly lowercased.
Please note: This class implements
Inheritance
Namespace: Lucene.Net.Analysis.Util
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public class CharArraySet : ISet<string>
Constructors
| Improve this Doc View SourceCharArraySet(LuceneVersion, ICollection<String>, Boolean)
Creates a set from a collection of objects.
Declaration
public CharArraySet(LuceneVersion matchVersion, ICollection<string> c, bool ignoreCase)
Parameters
| Type | Name | Description |
|---|---|---|
| LuceneVersion | matchVersion | compatibility match version see CharArraySet for details. |
| ICollection<System.String> | c | a collection whose elements to be placed into the set |
| System.Boolean | ignoreCase |
|
CharArraySet(LuceneVersion, Int32, Boolean)
Create set with enough capacity to hold startSize terms
Declaration
public CharArraySet(LuceneVersion matchVersion, int startSize, bool ignoreCase)
Parameters
| Type | Name | Description |
|---|---|---|
| LuceneVersion | matchVersion | compatibility match version see CharArraySet for details. |
| System.Int32 | startSize | the initial capacity |
| System.Boolean | ignoreCase |
|
Fields
| Improve this Doc View SourceEMPTY_SET
Declaration
public static readonly CharArraySet EMPTY_SET
Field Value
| Type | Description |
|---|---|
| CharArraySet |
Properties
| Improve this Doc View SourceCount
Gets the number of elements contained in the CharArraySet.
Declaration
public virtual int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
IsReadOnly
true if the CharArraySet is read-only; otherwise false.
Declaration
public virtual bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
| Improve this Doc View SourceAdd(ICharSequence)
Add this ICharSequence into the set
Declaration
public virtual bool Add(ICharSequence text)
Parameters
| Type | Name | Description |
|---|---|---|
| ICharSequence | text |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Add(Char[])
Add this char[] directly to the set.
If ignoreCase is true for this CharArraySet, the text array will be directly modified.
The user should never modify this text array after calling this method.
Declaration
public virtual bool Add(char[] text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Char[] | text |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Add(Object)
Add the o into the set.
The o is a value type, it will be converted using the
Declaration
public virtual bool Add(object o)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | o | A string-able object |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Add(String)
Add this
Declaration
public virtual bool Add(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Clear()
Clears all entries in this set. This method is supported for reusing, but not ICollection{string}.Remove(string).
Declaration
public virtual void Clear()
Contains(ICharSequence)
true if the ICharSequence is in the set
Declaration
public virtual bool Contains(ICharSequence cs)
Parameters
| Type | Name | Description |
|---|---|---|
| ICharSequence | cs |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Contains(Char[])
true if the char[]s
are in the set
Declaration
public virtual bool Contains(char[] text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Char[] | text |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Contains(Char[], Int32, Int32)
true if the length chars of text starting at offset
are in the set
Declaration
public virtual bool Contains(char[] text, int offset, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Char[] | text | |
| System.Int32 | offset | |
| System.Int32 | length |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Contains(Object)
true if the o is in the set
Declaration
public virtual bool Contains(object o)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | o |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Contains(String)
true if the
Declaration
public virtual bool Contains(string cs)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | cs |
Returns
| Type | Description |
|---|---|
| System.Boolean |
ContainsAll(IEnumerable<String>)
Returns true if this collection contains all of the elements
in the specified collection.
Declaration
public virtual bool ContainsAll(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other | collection to be checked for containment in this collection |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
ContainsAll<T>(IEnumerable<T>)
Returns true if this collection contains all of the elements
in the specified collection.
Declaration
public virtual bool ContainsAll<T>(IEnumerable<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | other | collection to be checked for containment in this collection |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T |
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.
Declaration
public static CharArraySet Copy<T>(LuceneVersion matchVersion, ICollection<T> set)
Parameters
| Type | Name | Description |
|---|---|---|
| LuceneVersion | matchVersion | compatibility match version. This argument will be ignored if the given set is a CharArraySet. |
| ICollection<T> | set | a set to copy |
Returns
| Type | Description |
|---|---|
| CharArraySet | a copy of the given set as a CharArraySet. If the given set is a CharArraySet the Lucene.Net.Analysis.Util.CharArrayMap`1.ignoreCase field as well as the MatchVersion will be preserved. |
Type Parameters
| Name | Description |
|---|---|
| T |
CopyTo(String[], Int32)
Copies the entire CharArraySet to a one-dimensional string[] array, starting at the specified index of the target array.
Declaration
public void CopyTo(string[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String[] | array | The one-dimensional string[] Array that is the destination of the elements copied from CharArraySet. The Array must have zero-based indexing. |
| System.Int32 | arrayIndex | The zero-based index in array at which copying begins. |
Equals(Object)
Compares the specified object with this set for equality. Returns true if the
given object is also a set, the two sets have the same size, and every member of the
given set is contained in this set. This ensures that the equals method works properly
across different implementations of the ISet{string} interface.
This implementation first checks if the specified object is this set; if so it
returns true. Then, it checks if the specified object is a set whose
size is identical to the size of this set; if not, it returns false. If so,
it uses the enumerator of this set and the specified object to determine if all of the
contained values are present (using
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | object to be compared for equality with this set |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
ExceptWith(IEnumerable<String>)
Declaration
public void ExceptWith(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other |
GetEnumerator()
Returns an
Declaration
public virtual IEnumerator GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator |
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 null element is defined to be zero.
This ensures that s1.Equals(s2) implies that
s1.GetHashCode()==s2.GetHashCode() for any two sets s1 and s2.
This implementation iterates over the set, calling the GetHashCode()
method on each element in the set, and adding up the results.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | the hash code value for this set |
IntersectWith(IEnumerable<String>)
Declaration
public void IntersectWith(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other |
IsProperSubsetOf(IEnumerable<String>)
Determines whether a CharArraySet object is a proper subset of the specified collection.
Declaration
public virtual bool IsProperSubsetOf(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsProperSubsetOf<T>(IEnumerable<T>)
Determines whether a CharArraySet object is a proper subset of the specified collection.
Declaration
public virtual bool IsProperSubsetOf<T>(IEnumerable<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T |
IsProperSupersetOf(IEnumerable<String>)
Determines whether a CharArraySet object is a proper superset of the specified collection.
Declaration
public virtual bool IsProperSupersetOf(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsProperSupersetOf<T>(IEnumerable<T>)
Determines whether a CharArraySet object is a proper superset of the specified collection.
Declaration
public virtual bool IsProperSupersetOf<T>(IEnumerable<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T |
IsSubsetOf(IEnumerable<String>)
Determines whether a CharArraySet object is a subset of the specified collection.
Declaration
public virtual bool IsSubsetOf(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsSubsetOf<T>(IEnumerable<T>)
Determines whether a CharArraySet object is a subset of the specified collection.
Declaration
public virtual bool IsSubsetOf<T>(IEnumerable<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T |
IsSupersetOf(IEnumerable<String>)
Determines whether a CharArraySet object is a superset of the specified collection.
Declaration
public virtual bool IsSupersetOf(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
IsSupersetOf<T>(IEnumerable<T>)
Determines whether a CharArraySet object is a superset of the specified collection.
Declaration
public virtual bool IsSupersetOf<T>(IEnumerable<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T |
Overlaps(IEnumerable<String>)
Determines whether the current CharArraySet object and a specified collection share common elements.
Declaration
public virtual bool Overlaps(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Overlaps<T>(IEnumerable<T>)
Determines whether the current CharArraySet object and a specified collection share common elements.
Declaration
public virtual bool Overlaps<T>(IEnumerable<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | other | The collection to compare to the current CharArraySet object. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T |
Remove(String)
Declaration
public virtual bool Remove(string item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | item |
Returns
| Type | Description |
|---|---|
| System.Boolean |
SetEquals(IEnumerable<String>)
Determines whether the current set and the specified collection contain the same elements.
Declaration
public virtual bool SetEquals(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other | The collection to compare to the current set. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
SymmetricExceptWith(IEnumerable<String>)
Declaration
public void SymmetricExceptWith(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other |
ToString()
Returns a string that represents the current object. (Inherited from
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |
UnionWith(IEnumerable<ICharSequence>)
Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both.
Declaration
public virtual bool UnionWith(IEnumerable<ICharSequence> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ICharSequence> | other | The collection whose elements should be merged into the CharArraySet. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
UnionWith(IEnumerable<Char[]>)
Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both.
Declaration
public virtual bool UnionWith(IEnumerable<char[]> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.Char[]> | other | The collection whose elements should be merged into the CharArraySet. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
UnionWith(IEnumerable<String>)
Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both.
Declaration
public virtual void UnionWith(IEnumerable<string> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | other | The collection whose elements should be merged into the CharArraySet. |
UnionWith<T>(IEnumerable<T>)
Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both.
Declaration
public virtual bool UnionWith<T>(IEnumerable<T> other)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | other | The collection whose elements should be merged into the CharArraySet. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Type Parameters
| Name | Description |
|---|---|
| T |
UnmodifiableSet(CharArraySet)
Returns an unmodifiable CharArraySet. This allows to provide unmodifiable views of internal sets for "read-only" use.
Declaration
public static CharArraySet UnmodifiableSet(CharArraySet set)
Parameters
| Type | Name | Description |
|---|---|---|
| CharArraySet | set | a set for which the unmodifiable set is returned. |
Returns
| Type | Description |
|---|---|
| CharArraySet | an new unmodifiable CharArraySet. |