Class CharArraySet
A simple class that stores 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 string first.
You must specify the required Lucene.Net.Util.LuceneVersion compatibility when creating CharArraySet:
- As of 3.1, supplementary characters are properly lowercased.
Please note: This class implements ISet<T> but does not behave like it should in all cases. The generic type is 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 ToString() and store the result using a char[] buffer. The same behavior have the Contains(string) methods. The GetEnumerator() returns an IEnumerator{char[]}
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Util
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public class CharArraySet : ISet<string>, ICollection<string>, ICollection, IReadOnlySet<string>, IReadOnlyCollection<string>, IEnumerable<string>, IEnumerable
Constructors
CharArraySet(LuceneVersion, IEnumerable<ICharSequence>, bool)
Creates a set from a collection of J2N.Text.ICharSequences.
Declaration
public CharArraySet(LuceneVersion matchVersion, IEnumerable<ICharSequence> collection, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | Compatibility match version see CharArraySet for details. |
IEnumerable<ICharSequence> | collection | A collection whose elements to be placed into the set. |
bool | ignoreCase |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
collection is null .
-or-
The J2N.Text.ICharSequence.HasValue property for a given element in the collection returns false .
|
CharArraySet(LuceneVersion, IEnumerable<char[]>, bool)
Creates a set from a collection of char[]s.
NOTE: IfignoreCase
is true
, the text arrays will be directly modified.
The user should never modify these text arrays after calling this method.
Declaration
public CharArraySet(LuceneVersion matchVersion, IEnumerable<char[]> collection, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | Compatibility match version see CharArraySet for details. |
IEnumerable<char[]> | collection | A collection whose elements to be placed into the set. |
bool | ignoreCase |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
collection is null .
|
CharArraySet(LuceneVersion, IEnumerable<string>, bool)
Creates a set from a collection of strings.
Declaration
public CharArraySet(LuceneVersion matchVersion, IEnumerable<string> collection, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | Compatibility match version see CharArraySet for details. |
IEnumerable<string> | collection | A collection whose elements to be placed into the set. |
bool | ignoreCase |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
collection is null .
|
CharArraySet(LuceneVersion, int, bool)
Create set with enough capacity to hold capacity
terms
Declaration
public CharArraySet(LuceneVersion matchVersion, int capacity, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | compatibility match version see CharArraySet for details. |
int | capacity | the initial capacity |
bool | ignoreCase |
|
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Fields
Empty
A simple class that stores 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 string first.
You must specify the required Lucene.Net.Util.LuceneVersion compatibility when creating CharArraySet:
- As of 3.1, supplementary characters are properly lowercased.
Please note: This class implements ISet<T> but does not behave like it should in all cases. The generic type is 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 ToString() and store the result using a char[] buffer. The same behavior have the Contains(string) methods. The GetEnumerator() returns an IEnumerator{char[]}
Declaration
public static readonly CharArraySet Empty
Field Value
Type | Description |
---|---|
CharArraySet |
Properties
Count
Gets the number of elements contained in the CharArraySet.
Declaration
public virtual int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsReadOnly
true
if the CharArraySet is read-only; otherwise false
.
Declaration
public virtual bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Add(ICharSequence)
Adds a J2N.Text.ICharSequence into the set
Declaration
public virtual bool Add(ICharSequence text)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text | The text to be added to the set. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Add(char[])
Adds a char[] directly to the set.
NOTE: IfignoreCase
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 |
---|---|---|
char[] | text | The text to be added to the set. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Add(char[], int, int)
Adds a char[] to the set using the specified startIndex
and length
.
ignoreCase
is true
for this CharArraySet, the text array will be directly modified.
Declaration
public virtual bool Add(char[] text, int startIndex, int length)
Parameters
Type | Name | Description |
---|---|---|
char[] | text | The text to be added to the set. |
int | startIndex | The position of the |
int | length | The total length of the |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException |
|
Add(string)
Adds a string into the set
Declaration
public virtual bool Add(string text)
Parameters
Type | Name | Description |
---|---|---|
string | text | The text to be added to the set. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Add<T>(T)
Adds the ToString() representation of text
into the set.
The ToString() method is called after setting the thread to InvariantCulture.
If the type of text
is a value type, it will be converted using the
InvariantCulture.
Declaration
public virtual bool Add<T>(T text)
Parameters
Type | Name | Description |
---|---|---|
T | text | A string-able object. |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
AsReadOnly()
Returns an unmodifiable CharArraySet. This allows to provide unmodifiable views of internal sets for "read-only" use.
Declaration
public virtual CharArraySet AsReadOnly()
Returns
Type | Description |
---|---|
CharArraySet | A new unmodifiable CharArraySet. |
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 J2N.Text.ICharSequence is in the set.
Declaration
public virtual bool Contains(ICharSequence text)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text |
Returns
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
text 's J2N.Text.ICharSequence.HasValue property returns false .
|
Contains(char[])
true
if the char[]s
are in the set
Declaration
public virtual bool Contains(char[] text)
Parameters
Type | Name | Description |
---|---|---|
char[] | text |
Returns
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Contains(char[], int, int)
true
if the length
chars of text
starting at startIndex
are in the set.
Declaration
public virtual bool Contains(char[] text, int startIndex, int length)
Parameters
Type | Name | Description |
---|---|---|
char[] | text | |
int | startIndex | |
int | length |
Returns
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException |
|
Contains(string)
true
if the string is in the set.
Declaration
public virtual bool Contains(string text)
Parameters
Type | Name | Description |
---|---|---|
string | text |
Returns
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Contains<T>(T)
true
if the ToString() representation of text
is in the set.
Declaration
public virtual bool Contains<T>(T text)
Parameters
Type | Name | Description |
---|---|---|
T | text |
Returns
Type | Description |
---|---|
bool |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CopyTo(ICharSequence[])
Copies the entire CharArraySet to a one-dimensional ICharSequence[] array, starting at the specified index of the target array.
Declaration
public void CopyTo(ICharSequence[] array)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence[] | array | The one-dimensional ICharSequence[] Array that is the destination of the elements copied from CharArraySet. The Array must have zero-based indexing. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | The number of elements in the source is greater than the available space in the destination array. |
CopyTo(ICharSequence[], int)
Copies the entire CharArraySet to a one-dimensional ICharSequence[] array, starting at the specified index of the target array.
Declaration
public void CopyTo(ICharSequence[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence[] | array | The one-dimensional ICharSequence[] Array that is the destination of the elements copied from CharArraySet. The Array must have zero-based indexing. |
int | arrayIndex | The zero-based index in array at which copying begins. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException | The number of elements in the source is greater
than the available space from |
CopyTo(IList<char[]>)
Copies the entire CharArraySet to a jagged char[][] array or IList<T> of type char[], starting at the specified index of the target array.
Declaration
public void CopyTo(IList<char[]> array)
Parameters
Type | Name | Description |
---|---|---|
IList<char[]> | array | The jagged char[][] array or IList<T> of type char[] that is the destination of the elements copied from CharArraySet. The Array must have zero-based indexing. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | The number of elements in the source is greater than the available space in the destination array. |
CopyTo(IList<char[]>, int)
Copies the entire CharArraySet to a jagged char[][] array or IList<T> of type char[] starting at the specified index of the target array.
Declaration
public void CopyTo(IList<char[]> array, int index)
Parameters
Type | Name | Description |
---|---|---|
IList<char[]> | array | The jagged char[][] array or IList<T> of type char[] that is the destination of the elements copied from CharArraySet. The Array must have zero-based indexing. |
int | index | The zero-based index in array at which copying begins. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException | The number of elements in the source is greater
than the available space from |
CopyTo(string[])
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)
Parameters
Type | Name | Description |
---|---|---|
string[] | array | The one-dimensional string[] Array that is the destination of the elements copied from CharArraySet. The Array must have zero-based indexing. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException | The number of elements in the source is greater than the available space in the destination array. |
CopyTo(string[], int)
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 |
---|---|---|
string[] | array | The one-dimensional string[] Array that is the destination of the elements copied from CharArraySet. The Array must have zero-based indexing. |
int | arrayIndex | The zero-based index in array at which copying begins. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException | The number of elements in the source is greater
than the available space from |
Copy<T>(LuceneVersion, IEnumerable<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 Lucene.Net.Util.LuceneVersion of the source set differs from its copy CharArraySet(LuceneVersion, IEnumerable<string>, bool) should be used instead. The Copy<T>(LuceneVersion, IEnumerable<T>) method will preserve the Lucene.Net.Util.LuceneVersion of the source set it is an instance of CharArraySet.
Declaration
public static CharArraySet Copy<T>(LuceneVersion matchVersion, IEnumerable<T> collection)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | compatibility match version. This argument will be ignored if the given set is a CharArraySet. |
IEnumerable<T> | collection | 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 ignoreCase field as well as the MatchVersion will be preserved. |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
collection is null .
-or-
The J2N.Text.ICharSequence.HasValue property for a given element in the collection returns false .
|
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.
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 Equals(string)).
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | object to be compared for equality with this set |
Returns
Type | Description |
---|---|
bool |
|
Overrides
GetEnumerator()
Returns an enumerator that iterates through the CharArraySet.
Declaration
public CharArraySet.Enumerator GetEnumerator()
Returns
Type | Description |
---|---|
CharArraySet.Enumerator | An enumerator that iterates through the CharArraySet. |
Remarks
An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to MoveNext() or Reset() throws an InvalidOperationException.
This method is anO(log n)
operation.
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 |
---|---|
int | the hash code value for this set |
Overrides
IsProperSubsetOf(IEnumerable<ICharSequence>)
Determines whether a CharArraySet object is a proper subset of the specified collection.
Declaration
public virtual bool IsProperSubsetOf(IEnumerable<ICharSequence> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ICharSequence> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsProperSubsetOf(IEnumerable<char[]>)
Determines whether a CharArraySet object is a proper subset of the specified collection.
Declaration
public virtual bool IsProperSubsetOf(IEnumerable<char[]> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<char[]> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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<string> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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 |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsProperSupersetOf(IEnumerable<ICharSequence>)
Determines whether a CharArraySet object is a proper superset of the specified collection.
Declaration
public virtual bool IsProperSupersetOf(IEnumerable<ICharSequence> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ICharSequence> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsProperSupersetOf(IEnumerable<char[]>)
Determines whether a CharArraySet object is a proper superset of the specified collection.
Declaration
public virtual bool IsProperSupersetOf(IEnumerable<char[]> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<char[]> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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<string> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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 |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsSubsetOf(IEnumerable<ICharSequence>)
Determines whether a CharArraySet object is a subset of the specified collection.
Declaration
public virtual bool IsSubsetOf(IEnumerable<ICharSequence> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ICharSequence> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsSubsetOf(IEnumerable<char[]>)
Determines whether a CharArraySet object is a subset of the specified collection.
Declaration
public virtual bool IsSubsetOf(IEnumerable<char[]> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<char[]> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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<string> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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 |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsSupersetOf(IEnumerable<ICharSequence>)
Determines whether a CharArraySet object is a superset of the specified collection.
Declaration
public virtual bool IsSupersetOf(IEnumerable<ICharSequence> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ICharSequence> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsSupersetOf(IEnumerable<char[]>)
Determines whether a CharArraySet object is a superset of the specified collection.
Declaration
public virtual bool IsSupersetOf(IEnumerable<char[]> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<char[]> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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<string> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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 |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Overlaps(IEnumerable<ICharSequence>)
Determines whether the current CharArraySet object and a specified collection share common elements.
Declaration
public virtual bool Overlaps(IEnumerable<ICharSequence> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ICharSequence> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Overlaps(IEnumerable<char[]>)
Determines whether the current CharArraySet object and a specified collection share common elements.
Declaration
public virtual bool Overlaps(IEnumerable<char[]> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<char[]> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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<string> | other | The collection to compare to the current CharArraySet object. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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 |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SetEquals(IEnumerable<ICharSequence>)
Determines whether the current set and the specified collection contain the same elements.
Declaration
public virtual bool SetEquals(IEnumerable<ICharSequence> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ICharSequence> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SetEquals(IEnumerable<char[]>)
Determines whether the current set and the specified collection contain the same elements.
Declaration
public virtual bool SetEquals(IEnumerable<char[]> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<char[]> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
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<string> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SetEquals<T>(IEnumerable<T>)
Determines whether the current set and the specified collection contain the same elements.
Declaration
public virtual bool SetEquals<T>(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToCharArraySet()
Returns a copy of this set as a new instance CharArraySet.
The Lucene.Net.Util.LuceneVersion and ignoreCase
property will be preserved.
Declaration
public virtual CharArraySet ToCharArraySet()
Returns
Type | Description |
---|---|
CharArraySet | A copy of this set as a new instance of CharArraySet. The ignoreCase field as well as the MatchVersion will be preserved. |
ToCharArraySet(LuceneVersion)
Returns a copy of this set as a new instance CharArraySet
with the provided matchVersion
.
The ignoreCase
property will be preserved from this CharArraySet.
Declaration
public virtual CharArraySet ToCharArraySet(LuceneVersion matchVersion)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion |
Returns
Type | Description |
---|---|
CharArraySet | A copy of this set as a new instance of CharArraySet. The ignoreCase field will be preserved. |
ToCharArraySet(LuceneVersion, bool)
Returns a copy of this set as a new instance CharArraySet
with the provided matchVersion
and ignoreCase
values.
Declaration
public virtual CharArraySet ToCharArraySet(LuceneVersion matchVersion, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | |
bool | ignoreCase |
Returns
Type | Description |
---|---|
CharArraySet | A copy of this set as a new instance of CharArraySet. |
ToString()
Returns a string that represents the current collection.
The presentation has a specific format. It is enclosed by curly brackets ("{}"). Keys and values are separated by '=', KeyValuePairs are separated by ', ' (comma and space).null
values are represented as the string "null".
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current collection. |
Overrides
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 |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
null .
-or-
The J2N.Text.ICharSequence.HasValue property for a given element in the collection returns false .
|
NotSupportedException | This set instance is read-only. |
UnionWith(IEnumerable<char[]>)
Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both.
NOTE: IfignoreCase
is true
for this CharArraySet, the text arrays will be directly modified.
The user should never modify these text arrays after calling this method.
Declaration
public virtual bool UnionWith(IEnumerable<char[]> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<char[]> | other | The collection whose elements should be merged into the CharArraySet. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
NotSupportedException | This set instance is read-only. |
UnionWith(IEnumerable<string>)
Modifies the current CharArraySet to contain all elements that are present in itself, the specified collection, or both.
Declaration
public virtual bool UnionWith(IEnumerable<string> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | other | The collection whose elements should be merged into the CharArraySet. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
NotSupportedException | This set instance is read-only. |
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 |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
NotSupportedException | This set instance is read-only. |