Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
Lucene.Net.Analysis.CharArraySet Class Reference

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]
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

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 bool Lucene.Net.Analysis.CharArraySet.Contains ( char[]  text,
int  off,
int  len 
)
virtual

true if the len chars of text starting at off are in the set

Definition at line 104 of file CharArraySet.cs.

virtual bool Lucene.Net.Analysis.CharArraySet.Contains ( string  text)
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 CharArraySet Lucene.Net.Analysis.CharArraySet.Copy< T > ( ISet< T >  set)
static

returns a copy of the given set as a CharArraySet. If the given set is a CharArraySet the ignoreCase property will be preserved.

Parameters
setA set to copy
Returns
a copy of the given set as a CharArraySet. If the given set is a CharArraySet the ignoreCase property will be preserved.

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 CharArraySet Lucene.Net.Analysis.CharArraySet.UnmodifiableSet ( CharArraySet  set)
static

Returns an unmodifiable CharArraySet. This allows to provide unmodifiable views of internal sets for "read-only" use

Parameters
setA Set for which the unmodifiable set it returns.
Returns
A new unmodifiable CharArraySet

<throws>ArgumentNullException of the given set is null</throws>

Definition at line 324 of file CharArraySet.cs.

Member Data Documentation

CharArraySet Lucene.Net.Analysis.CharArraySet.EMPTY_SET = UnmodifiableSet(new CharArraySet(0, false))
static

Definition at line 53 of file CharArraySet.cs.

Property Documentation

int Lucene.Net.Analysis.CharArraySet.Count
get

Definition at line 292 of file CharArraySet.cs.

bool Lucene.Net.Analysis.CharArraySet.IsEmpty
get

Definition at line 297 of file CharArraySet.cs.

bool Lucene.Net.Analysis.CharArraySet.IsReadOnly
getset

Definition at line 362 of file CharArraySet.cs.


The documentation for this class was generated from the following file: