Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
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. Please note: This class implements System.Collections.Generic.ISet{T} but does not behave like it should in all cases. The generic type is System.Collections.Generic.ICollection{T}, because you can add any object to it, that has a string representation. The add methods will use object.ToString() and store the result using a char buffer. The same behaviour have the Contains(object) methods. The GetEnumerator method returns an string IEnumerable. For type safety also stringIterator() is provided. More...
Inherits ISet< string >.
Classes | |
class | CharArraySetEnumerator |
The IEnumerator<String> for this set. Strings are constructed on the fly, so use nextCharArray for more efficient access More... | |
Public Member Functions | |
CharArraySet (int startSize, bool ignoreCase) | |
Create set with enough capacity to hold startSize terms | |
CharArraySet (IEnumerable< string > c, bool ignoreCase) | |
CharArraySet (IEnumerable< object > c, bool ignoreCase) | |
Create set from a Collection of char[] or String | |
virtual bool | Contains (char[] text, int off, int len) |
true if the len chars of text starting at off are in the set | |
virtual bool | Contains (string text) |
bool | Add (string text) |
bool | Add (char[] text) |
Add this char[] directly to the set. If ignoreCase is true for this Set, the text array will be directly modified. The user should never modify this text array after calling this method. | |
bool | Contains (object item) |
bool | Add (object item) |
void | Clear () |
void | UnionWith (IEnumerable< string > other) |
Adds all of the elements in the specified collection to this collection | |
void | AddAll (IEnumerable< string > coll) |
Wrapper that calls UnionWith | |
void | RemoveAll (ICollection< string > c) |
void | RetainAll (ICollection< string > c) |
IEnumerator< string > | StringEnumerator () |
IEnumerator< string > | GetEnumerator () |
Static Public Member Functions | |
static CharArraySet | UnmodifiableSet (CharArraySet set) |
Returns an unmodifiable CharArraySet. This allows to provide unmodifiable views of internal sets for "read-only" use | |
static CharArraySet | Copy< T > (ISet< T > set) |
returns a copy of the given set as a CharArraySet. If the given set is a CharArraySet the ignoreCase property will be preserved. | |
Static Public Attributes | |
static CharArraySet | EMPTY_SET = UnmodifiableSet(new CharArraySet(0, false)) |
Properties | |
int | Count [get] |
bool | IsEmpty [get] |
bool | IsReadOnly [get, set] |
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.
Please note: This class implements System.Collections.Generic.ISet{T} but does not behave like it should in all cases. The generic type is System.Collections.Generic.ICollection{T}, because you can add any object to it, that has a string representation. The add methods will use object.ToString() and store the result using a char buffer. The same behaviour have the Contains(object) methods. The GetEnumerator method returns an string IEnumerable. For type safety also stringIterator() is provided.
Definition at line 46 of file CharArraySet.cs.
Lucene.Net.Analysis.CharArraySet.CharArraySet | ( | int | startSize, |
bool | ignoreCase | ||
) |
Create set with enough capacity to hold startSize terms
Definition at line 67 of file CharArraySet.cs.
Lucene.Net.Analysis.CharArraySet.CharArraySet | ( | IEnumerable< string > | c, |
bool | ignoreCase | ||
) |
Definition at line 72 of file CharArraySet.cs.
Lucene.Net.Analysis.CharArraySet.CharArraySet | ( | IEnumerable< object > | c, |
bool | ignoreCase | ||
) |
Create set from a Collection of char[] or String
Definition at line 79 of file CharArraySet.cs.
bool Lucene.Net.Analysis.CharArraySet.Add | ( | string | text | ) |
Definition at line 154 of file CharArraySet.cs.
bool Lucene.Net.Analysis.CharArraySet.Add | ( | char[] | text | ) |
Add this char[] directly to the set. If ignoreCase is true for this Set, the text array will be directly modified. The user should never modify this text array after calling this method.
Definition at line 164 of file CharArraySet.cs.
bool Lucene.Net.Analysis.CharArraySet.Add | ( | object | item | ) |
Definition at line 307 of file CharArraySet.cs.
void Lucene.Net.Analysis.CharArraySet.AddAll | ( | IEnumerable< string > | coll | ) |
Wrapper that calls UnionWith
Definition at line 379 of file CharArraySet.cs.
void Lucene.Net.Analysis.CharArraySet.Clear | ( | ) |
Definition at line 356 of file CharArraySet.cs.
|
virtual |
true if the len
chars of text
starting at off
are in the set
Definition at line 104 of file CharArraySet.cs.
|
virtual |
Definition at line 109 of file CharArraySet.cs.
bool Lucene.Net.Analysis.CharArraySet.Contains | ( | object | item | ) |
Definition at line 301 of file CharArraySet.cs.
|
static |
returns a copy of the given set as a CharArraySet. If the given set is a CharArraySet the ignoreCase property will be preserved.
set | A set to copy |
Definition at line 344 of file CharArraySet.cs.
IEnumerator<string> Lucene.Net.Analysis.CharArraySet.GetEnumerator | ( | ) |
Definition at line 506 of file CharArraySet.cs.
void Lucene.Net.Analysis.CharArraySet.RemoveAll | ( | ICollection< string > | c | ) |
Definition at line 385 of file CharArraySet.cs.
void Lucene.Net.Analysis.CharArraySet.RetainAll | ( | ICollection< string > | c | ) |
Definition at line 390 of file CharArraySet.cs.
IEnumerator<string> Lucene.Net.Analysis.CharArraySet.StringEnumerator | ( | ) |
Definition at line 501 of file CharArraySet.cs.
void Lucene.Net.Analysis.CharArraySet.UnionWith | ( | IEnumerable< string > | other | ) |
Adds all of the elements in the specified collection to this collection
Definition at line 368 of file CharArraySet.cs.
|
static |
Returns an unmodifiable CharArraySet. This allows to provide unmodifiable views of internal sets for "read-only" use
set | A Set for which the unmodifiable set it returns. |
<throws>ArgumentNullException of the given set is null
</throws>
Definition at line 324 of file CharArraySet.cs.
|
static |
Definition at line 53 of file CharArraySet.cs.
|
get |
Definition at line 292 of file CharArraySet.cs.
|
get |
Definition at line 297 of file CharArraySet.cs.
|
getset |
Definition at line 362 of file CharArraySet.cs.