<html xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" /><META NAME="save" CONTENT="history" /><title>Lucene.Net.Util Namespace</title><meta name="Language" content="en-us" /><meta name="System.Keywords" content="Lucene.Net.Util namespace" /><meta name="Microsoft.Help.F1" content="Lucene.Net.Util" /><meta name="Microsoft.Help.Id" content="N:Lucene.Net.Util" /><meta name="Description" content="[Missing <summary> documentation for "N:Lucene.Net.Util"]" /><meta name="Microsoft.Help.ContentType" content="Reference" /><link rel="stylesheet" type="text/css" href="../styles/Presentation.css" /><link rel="stylesheet" type="text/css" href="ms-help://Hx/HxRuntime/HxLink.css" /><script type="text/javascript" src="../scripts/EventUtilities.js"> </script><script type="text/javascript" src="../scripts/SplitScreen.js"> </script><script type="text/javascript" src="../scripts/Dropdown.js"> </script><script type="text/javascript" src="../scripts/script_manifold.js"> </script><script type="text/javascript" src="../scripts/script_feedBack.js"> </script><script type="text/javascript" src="../scripts/CheckboxMenu.js"> </script><script type="text/javascript" src="../scripts/CommonUtilities.js"> </script><meta name="container" content="Lucene.Net.Util" /><meta name="file" content="bfbf4297-ad1e-815b-caa8-da087ce3f1e3" /><meta name="guid" content="bfbf4297-ad1e-815b-caa8-da087ce3f1e3" /><xml><MSHelp:Attr Name="AssetID" Value="N:Lucene.Net.Util" /><MSHelp:TOCTitle Title="Lucene.Net.Util Namespace" /><MSHelp:RLTitle Title="Lucene.Net.Util Namespace ()" /><MSHelp:Keyword Index="A" Term="N:Lucene.Net.Util" /><MSHelp:Keyword Index="A" Term="frlrfLuceneNetUtil" /><MSHelp:Keyword Index="K" Term="Lucene.Net.Util namespace" /><MSHelp:Keyword Index="F" Term="Lucene.Net.Util" /><MSHelp:Attr Name="HelpPriority" Value="1" /><MSHelp:Attr Name="DevLang" Value="CSharp" /><MSHelp:Attr Name="DevLang" Value="VB" /><MSHelp:Attr Name="Locale" Value="en-us" /><MSHelp:Attr Name="TopicType" Value="kbSyntax" /><MSHelp:Attr Name="TopicType" Value="apiref" /><MSHelp:Attr Name="Abstract" Value="[Missing <summary> documentation for "N:Lucene.Net.Util"]" /></xml><link type="text/css" rel="stylesheet" href="../styles/highlight.css" /><script type="text/javascript" src="../scripts/highlight.js"> </script></head><body><input type="hidden" id="userDataCache" class="userDataStyle" /><input type="hidden" id="hiddenScrollOffset" /><img id="collapseImage" style="display:none; height:0; width:0;" src="../icons/collapse_all.gif" alt="Collapse image" title="Collapse image" /><img id="expandImage" style="display:none; height:0; width:0;" src="../icons/expand_all.gif" alt="Expand Image" title="Expand Image" /><img id="collapseAllImage" style="display:none; height:0; width:0;" src="../icons/collapse_all.gif" /><img id="expandAllImage" style="display:none; height:0; width:0;" src="../icons/expand_all.gif" /><img id="dropDownImage" style="display:none; height:0; width:0;" src="../icons/dropdown.gif" /><img id="dropDownHoverImage" style="display:none; height:0; width:0;" src="../icons/dropdownHover.gif" /><img id="copyImage" style="display:none; height:0; width:0;" src="../icons/copycode.gif" alt="Copy image" title="Copy image" /><img id="copyHoverImage" style="display:none; height:0; width:0;" src="../icons/copycodeHighlight.gif" alt="CopyHover image" title="CopyHover image" /><div id="header"><table id="topTable" cellspacing="0" cellpadding="0"><tr><td><span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage, event)" tabindex="0"><img ID="toggleAllImage" class="toggleAll" src="../icons/collapse_all.gif" /> <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">Collapse All</label><label id="expandAllLabel" for="toggleAllImage" style="display: none;">Expand All</label> </span><span> </span><span id="devlangsDropdown" class="filter" tabindex="0"><img id="devlangsDropdownImage" src="../icons/dropdown.gif" /> <label id="devlangsMenuAllLabel" for="devlangsDropdownImage" style="display: none;"><nobr>Code: All </nobr></label><label id="devlangsMenuMultipleLabel" for="devlangsDropdownImage" style="display: none;"><nobr>Code: Multiple </nobr></label><label id="devlangsMenuCSharpLabel" for="devlangsDropdownImage" style="display: none;"><nobr>Code: C# </nobr></label><label id="devlangsMenuVisualBasicLabel" for="devlangsDropdownImage" style="display: none;"><nobr>Code: Visual Basic </nobr></label><label id="devlangsMenuManagedCPlusPlusLabel" for="devlangsDropdownImage" style="display: none;"><nobr>Code: Visual C++ </nobr></label></span></td></tr></table><div id="devlangsMenu"><input id="CSharpCheckbox" type="checkbox" data="CSharp,cs,'persist'" value="on" onClick="SetLanguage(this)" /><label class="checkboxLabel" for="CSharpCheckbox">C#</label><br /><input id="VisualBasicCheckbox" type="checkbox" data="VisualBasic,vb,'persist'" value="on" onClick="SetLanguage(this)" /><label class="checkboxLabel" for="VisualBasicCheckbox">Visual Basic</label><br /><input id="ManagedCPlusPlusCheckbox" type="checkbox" data="ManagedCPlusPlus,cpp,'persist'" value="on" onClick="SetLanguage(this)" /><label class="checkboxLabel" for="ManagedCPlusPlusCheckbox">Visual C++</label><br /></div><table id="bottomTable" cellpadding="0" cellspacing="0"><tr id="headerTableRow1"><td align="left"><span id="runningHeaderText">Lucene.Net Class Libraries</span></td></tr><tr id="headerTableRow2"><td align="left"><span id="nsrTitle">Lucene.Net.Util Namespace</span></td></tr><tr id="headerTableRow3"><td align="left"><span id="headfeedbackarea" class="feedbackhead"><a href="javascript:SubmitFeedback('','Lucene.Net Class Libraries','','','','%0\dYour%20feedback%20is%20used%20to%20improve%20the%20documentation%20and%20the%20product.%20Your%20e-mail%20address%20will%20not%20be%20used%20for%20any%20other%20purpose%20and%20is%20disposed%20of%20after%20the%20issue%20you%20report%20is%20resolved.%20%20While%20working%20to%20resolve%20the%20issue%20that%20you%20report,%20you%20may%20be%20contacted%20via%20e-mail%20to%20get%20further%20details%20or%20clarification%20on%20the%20feedback%20you%20sent.%20After%20the%20issue%20you%20report%20has%20been%20addressed,%20you%20may%20receive%20an%20e-mail%20to%20let%20you%20know%20that%20your%20feedback%20has%20been%20addressed.%0\A%0\d','Customer%20Feedback');">Send Feedback</a></span></td></tr></table><table id="gradientTable"><tr><td class="nsrBottom" background="../icons/gradient.gif" /></tr></table></div><div id="mainSection"><div id="mainBody"><div id="allHistory" class="saveHistory" onsave="saveAll()" onload="loadAll()" /><span style="color: DarkGray"></span><div class="summary"><p style="color: #dc143c; font-size: 8.5pt; font-weight: bold;">[Missing <summary> documentation for "N:Lucene.Net.Util"]</p></div><h1 class="heading"><span onclick="ExpandCollapse(classToggle)" style="cursor:default;" onkeypress="ExpandCollapse_CheckKey(classToggle, event)" tabindex="0"><img id="classToggle" class="toggle" name="toggleSwitch" src="../icons/collapse_all.gif" />Classes</span></h1><div id="classSection" class="section" name="collapseableSection" style=""><table id="typeList" class="members" frame="lhs" cellpadding="2"><col width="10%" /><tr><th class="iconColumn"> | |
</th><th class="nameColumn">Class</th><th class="descriptionColumn">Description</th></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="0ac59b71-83fa-c1a3-79ec-7cd4d76c3cc7.htm">ArrayUtil</a></td><td><div class="summary"> Methods for manipulating arrays.</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="5be1c034-4241-eedc-bb26-f61f8eaa18f7.htm">AttributeImpl</a></td><td><div class="summary"> Base class for Attributes that can be added to a | |
{@link Lucene.Net.Util.AttributeSource}. | |
<p /> | |
Attributes are used to add data in a dynamic, yet type-safe way to a source | |
of usually streamed objects, e. g. a {@link Lucene.Net.Analysis.TokenStream}. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="73348f88-e7e1-7f51-9263-e94c55c78581.htm">AttributeSource</a></td><td><div class="summary"> An AttributeSource contains a list of different {@link AttributeImpl}s, | |
and methods to add and get them. There can only be a single instance | |
of an attribute in the same AttributeSource instance. This is ensured | |
by passing in the actual type of the Attribute (Class<Attribute>) to | |
the {@link #AddAttribute(Class)}, which then checks if an instance of | |
that type is already present. If yes, it returns the instance, otherwise | |
it creates a new instance and returns it. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="65051b79-68a2-9433-935f-8f84c0d19947.htm">AttributeSource<span class="languageSpecificText"><span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span><span class="fs">.</span></span>AttributeFactory</a></td><td><div class="summary"> An AttributeFactory creates instances of {@link AttributeImpl}s.</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="4b62a955-e192-fe13-d152-09816a3638bc.htm">AttributeSource<span class="languageSpecificText"><span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span><span class="fs">.</span></span>State</a></td><td><div class="summary"> This class holds the state of an AttributeSource.</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="00080609-2cd8-0f05-3e94-b898e3621d88.htm">AverageGuessMemoryModel</a></td><td><div class="summary"> An average, best guess, MemoryModel that should work okay on most systems. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="04971342-1be5-2e5c-f9f9-873a75f2d535.htm">BitUtil</a></td><td><div class="summary">A variety of high efficiencly bit twiddling routines. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="395dd338-7bfe-44a6-257a-c5b795611962.htm">BitVector</a></td><td><div class="summary">Optimized implementation of a vector of bits. This is more-or-less like | |
java.util.BitSet, but also includes the following: | |
<ul><li>a count() method, which efficiently computes the number of one bits;</li><li>optimized read from and write to disk;</li><li>inlinable get() method;</li><li>store and load, as bit set or d-gaps, depending on sparseness;</li></ul></div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="d4f33bb2-a5a1-1562-9532-073619b45fa0.htm">CloseableThreadLocal</a></td><td><div class="summary">Java's builtin ThreadLocal has a serious flaw: | |
it can take an arbitrarily long amount of time to | |
dereference the things you had stored in it, even once the | |
ThreadLocal instance itself is no longer referenced. | |
This is because there is single, master map stored for | |
each thread, which all ThreadLocals share, and that | |
master map only periodically purges "stale" entries. | |
While not technically a memory leak, because eventually | |
the memory will be reclaimed, it can take a long time | |
and you can easily hit OutOfMemoryError because from the | |
GC's standpoint the stale entries are not reclaimaible. | |
This class works around that, by only enrolling | |
WeakReference values into the ThreadLocal, and | |
separately holding a hard reference to each stored | |
value. When you call {@link #close}, these hard | |
references are cleared and then GC is freely able to | |
reclaim space by objects stored in it. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="cb4163d0-e73b-a97f-7d01-b81e356075b0.htm">Constants</a></td><td><div class="summary"> Some useful constants. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="98cea794-1a6f-77ca-4902-a7acf1800769.htm">DocIdBitSet</a></td><td><div class="summary">Simple DocIdSet and DocIdSetIterator backed by a BitSet </div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="41fbba0d-d8e8-91c6-9305-e3729702f935.htm">FieldCacheSanityChecker</a></td><td><div class="summary"> Provides methods for sanity checking that entries in the FieldCache | |
are not wasteful or inconsistent. | |
<p /><p /> | |
Lucene 2.9 Introduced numerous enhancements into how the FieldCache | |
is used by the low levels of Lucene searching (for Sorting and | |
ValueSourceQueries) to improve both the speed for Sorting, as well | |
as reopening of IndexReaders. But these changes have shifted the | |
usage of FieldCache from "top level" IndexReaders (frequently a | |
MultiReader or DirectoryReader) down to the leaf level SegmentReaders. | |
As a result, existing applications that directly access the FieldCache | |
may find RAM usage increase significantly when upgrading to 2.9 or | |
Later. This class provides an API for these applications (or their | |
Unit tests) to check at run time if the FieldCache contains "insane" | |
usages of the FieldCache. | |
<p /><p /><b>EXPERIMENTAL API:</b> This API is considered extremely advanced and | |
experimental. It may be removed or altered w/o warning in future releases | |
of Lucene. | |
<p /></div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="b6debf02-375e-71ca-537a-bf5d50d9ae41.htm">FieldCacheSanityChecker<span class="languageSpecificText"><span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span><span class="fs">.</span></span>Insanity</a></td><td><div class="summary"> Simple container for a collection of related CacheEntry objects that | |
in conjunction with eachother represent some "insane" usage of the | |
FieldCache. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="73bc5d33-dc95-2ff3-6b4b-217b4232873b.htm">FieldCacheSanityChecker<span class="languageSpecificText"><span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span><span class="fs">.</span></span>InsanityType</a></td><td><div class="summary"> An Enumaration of the differnet types of "insane" behavior that | |
may be detected in a FieldCache. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="6a119e34-4d25-e66d-31c6-16d5d42879ef.htm">IndexableBinaryStringTools</a></td><td><div class="summary"> Provides support for converting byte sequences to Strings and back again. | |
The resulting Strings preserve the original byte sequences' sort order. | |
The Strings are constructed using a Base 8000h encoding of the original | |
binary data - each char of an encoded String represents a 15-bit chunk | |
from the byte sequence. Base 8000h was chosen because it allows for all | |
lower 15 bits of char to be used without restriction; the surrogate range | |
[U+D8000-U+DFFF] does not represent valid chars, and would require | |
complicated handling to avoid them and allow use of char's high bit. | |
Although unset bits are used as padding in the final char, the original | |
byte sequence could contain trailing bytes with no set bits (null bytes): | |
padding is indistinguishable from valid information. To overcome this | |
problem, a char is appended, indicating the number of encoded bytes in the | |
final content char. | |
This class's operations are defined over CharBuffers and ByteBuffers, to | |
allow for wrapped arrays to be reused, reducing memory allocation costs for | |
repeated operations. Note that this class calls array() and arrayOffset() | |
on the CharBuffers and ByteBuffers it uses, so only wrapped arrays may be | |
used. This class interprets the arrayOffset() and limit() values returned by | |
its input buffers as beginning and end+1 positions on the wrapped array, | |
resprectively; similarly, on the output buffer, arrayOffset() is the first | |
position written to, and limit() is set to one past the final output array | |
position. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="87fdb8a2-9ec8-b43f-cd99-d35557c42d72.htm">MapOfSets<span class="languageSpecificText"><span class="cs"><</span><span class="vb">(Of </span><span class="cpp"><</span><span class="nu">(</span><span class="fs"><'</span></span>T, V<span class="languageSpecificText"><span class="cs">></span><span class="vb">)</span><span class="cpp">></span><span class="nu">)</span><span class="fs">></span></span></a></td><td><div class="summary"> Helper class for keeping Listss of Objects associated with keys. <b>WARNING: THIS CLASS IS NOT THREAD SAFE</b></div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="d46df96f-bf9d-a9ec-e13a-960703cd88b2.htm">MemoryModel</a></td><td><div class="summary"> Returns primitive memory sizes for estimating RAM usage. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="507b339f-5348-3819-1951-9987098aa2f9.htm">NumericUtils</a></td><td><div class="summary"> This is a helper class to generate prefix-encoded representations for numerical values | |
and supplies converters to represent float/double values as sortable integers/longs. | |
<p />To quickly execute range queries in Apache Lucene, a range is divided recursively | |
into multiple intervals for searching: The center of the range is searched only with | |
the lowest possible precision in the trie, while the boundaries are matched | |
more exactly. This reduces the number of terms dramatically. | |
<p />This class generates terms to achive this: First the numerical integer values need to | |
be converted to strings. For that integer values (32 bit or 64 bit) are made unsigned | |
and the bits are converted to ASCII chars with each 7 bit. The resulting string is | |
sortable like the original integer value. Each value is also prefixed | |
(in the first char) by the <span id="cbc_6" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve">shift</pre></div></span> value (number of bits removed) used | |
during encoding. | |
<p />To also index floating point numbers, this class supplies two methods to convert them | |
to integer values by changing their bit layout: {@link #doubleToSortableLong}, | |
{@link #floatToSortableInt}. You will have no precision loss by | |
converting floating point numbers to integers and back (only that the integer form | |
is not usable). Other data types like dates can easily converted to longs or ints (e.g. | |
date to long: {@link java.util.Date#getTime}). | |
<p />For easy usage, the trie algorithm is implemented for indexing inside | |
{@link NumericTokenStream} that can index <span id="cbc_7" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve"><span class="highlight-keyword">int</span></pre></div></span>, <span id="cbc_8" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve"><span class="highlight-keyword">long</span></pre></div></span>, | |
<span id="cbc_9" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve"><span class="highlight-keyword">float</span></pre></div></span>, and <span id="cbc_10" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve"><span class="highlight-keyword">double</span></pre></div></span>. For querying, | |
{@link NumericRangeQuery} and {@link NumericRangeFilter} implement the query part | |
for the same data types. | |
<p />This class can also be used, to generate lexicographically sortable (according | |
{@link String#compareTo(String)}) representations of numeric data types for other | |
usages (e.g. sorting). | |
<p /><font color="red"><b>NOTE:</b> This API is experimental and | |
might change in incompatible ways in the next release.</font></div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="2fef26ec-e520-1031-0eb9-929610f4b93c.htm">NumericUtils<span class="languageSpecificText"><span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span><span class="fs">.</span></span>IntRangeBuilder</a></td><td><div class="summary"> Expert: Callback for {@link #splitIntRange}. | |
You need to overwrite only one of the methods. | |
<p /><font color="red"><b>NOTE:</b> This is a very low-level interface, | |
the method signatures may change in later versions.</font></div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="8c4b4843-1b0a-9af3-4735-adab715bab87.htm">NumericUtils<span class="languageSpecificText"><span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span><span class="fs">.</span></span>LongRangeBuilder</a></td><td><div class="summary"> Expert: Callback for {@link #splitLongRange}. | |
You need to overwrite only one of the methods. | |
<p /><font color="red"><b>NOTE:</b> This is a very low-level interface, | |
the method signatures may change in later versions.</font></div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="28aa1314-5236-8692-c400-b6ec911f4cff.htm">OpenBitSet</a></td><td><div class="summary">An "open" BitSet implementation that allows direct access to the array of words | |
storing the bits. | |
<p /> | |
Unlike java.util.bitset, the fact that bits are packed into an array of longs | |
is part of the interface. This allows efficient implementation of other algorithms | |
by someone other than the author. It also allows one to efficiently implement | |
alternate serialization or interchange formats. | |
<p /><span id="cbc_2" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve">OpenBitSet</pre></div></span> is faster than <span id="cbc_3" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve">java.util.BitSet</pre></div></span> in most operations | |
and *much* faster at calculating cardinality of sets and results of set operations. | |
It can also handle sets of larger cardinality (up to 64 * 2**32-1) | |
<p /> | |
The goals of <span id="cbc_4" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve">OpenBitSet</pre></div></span> are the fastest implementation possible, and | |
maximum code reuse. Extra safety and encapsulation | |
may always be built on top, but if that's built in, the cost can never be removed (and | |
hence people re-implement their own version in order to get better performance). | |
If you want a "safe", totally encapsulated (and slower and limited) BitSet | |
class, use <span id="cbc_5" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve">java.util.BitSet</pre></div></span>. | |
<p /><h3>Performance Results</h3> | |
Test system: Pentium 4, Sun Java 1.5_06 -server -Xbatch -Xmx64M | |
<br />BitSet size = 1,000,000 | |
<br />Results are java.util.BitSet time divided by OpenBitSet time. | |
<table border="1"><tr><th /><th>cardinality</th><th>intersect_count</th><th>union</th><th>nextSetBit</th><th>get</th><th>iterator</th></tr><tr><th>50% full</th><td>3.36</td><td>3.96</td><td>1.44</td><td>1.46</td><td>1.99</td><td>1.58</td></tr><tr><th>1% full</th><td>3.31</td><td>3.90</td><td> </td><td>1.04</td><td> </td><td>0.99</td></tr></table><br /> | |
Test system: AMD Opteron, 64 bit linux, Sun Java 1.5_06 -server -Xbatch -Xmx64M | |
<br />BitSet size = 1,000,000 | |
<br />Results are java.util.BitSet time divided by OpenBitSet time. | |
<table border="1"><tr><th /><th>cardinality</th><th>intersect_count</th><th>union</th><th>nextSetBit</th><th>get</th><th>iterator</th></tr><tr><th>50% full</th><td>2.50</td><td>3.50</td><td>1.00</td><td>1.03</td><td>1.12</td><td>1.25</td></tr><tr><th>1% full</th><td>2.51</td><td>3.49</td><td> </td><td>1.00</td><td> </td><td>1.02</td></tr></table></div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="46df494e-b7b0-f6a2-be66-79103fb1c6fe.htm">OpenBitSetDISI</a></td><td /></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="812ace41-5edf-1096-834d-f0e9618b08b3.htm">OpenBitSetIterator</a></td><td><div class="summary">An iterator to iterate over set bits in an OpenBitSet. | |
This is faster than nextSetBit() for iterating over the complete set of bits, | |
especially when the density of the bits set is high. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="68f6fd48-8fc9-f421-5342-ed1ed45084c0.htm">Parameter</a></td><td><div class="summary"> A serializable Enum class.</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="e2e5a95e-66ba-47d6-6540-6bf9e90ecddc.htm">PriorityQueue</a></td><td><div class="summary">A PriorityQueue maintains a partial ordering of its elements such that the | |
least element can always be found in constant time. Put()'s and pop()'s | |
require log(size) time. | |
<p /><b>NOTE</b>: This class pre-allocates a full array of | |
length <span id="cbc_1" x-lang="CSharp" codeLanguage="CSharp"><div class="highlight-title"><span class="highlight-copycode" onkeypress="javascript:CopyColorizedCodeCheckKey(this.parentNode, event);" tabindex="0" onmouseover="CopyCodeChangeIcon(this)" onmouseout="CopyCodeChangeIcon(this)" onclick="javascript:CopyColorizedCode(this.parentNode);"><img style="margin-right: 5px;" src="../icons/CopyCode.gif" />Copy</span>C#</div><div class="code"><pre xml:space="preserve">maxSize<span class="highlight-number">+1</span></pre></div></span>, in {@link #initialize}. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="da62f888-0a41-07b6-f606-2f0d5076dbd1.htm">RamUsageEstimator</a></td><td><div class="summary"> Estimates the size of a given Object using a given MemoryModel for primitive | |
size information. | |
Resource Usage: | |
Internally uses a Map to temporally hold a reference to every | |
object seen. | |
If checkIntered, all Strings checked will be interned, but those | |
that were not already interned will be released for GC when the | |
estimate is complete. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="fde48a93-c702-53d1-9634-af406e902a1e.htm">ReaderUtil</a></td><td><div class="summary"> Common util methods for dealing with {@link IndexReader}s. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="bea88c59-9812-8ab0-f542-d0174b651b8b.htm">ScorerDocQueue</a></td><td><div class="summary">A ScorerDocQueue maintains a partial ordering of its Scorers such that the | |
least Scorer can always be found in constant time. Put()'s and pop()'s | |
require log(size) time. The ordering is by Scorer.doc(). | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="f31f7efa-693c-1f85-7ff6-965e72e39748.htm">SimpleStringInterner</a></td><td><div class="summary"> Simple lockless and memory barrier free String intern cache that is guaranteed | |
to return the same String instance as String.intern() does. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="aba932bd-0311-7670-80b9-43acaad037a5.htm">SmallFloat</a></td><td><div class="summary">Floating point numbers smaller than 32 bits. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="17622b00-36c2-3b24-6132-b0a3cee1c9d6.htm">SortedVIntList</a></td><td><div class="summary"> Stores and iterate on sorted integers in compressed form in RAM. <br /> | |
The code for compressing the differences between ascending integers was | |
borrowed from {@link Lucene.Net.Store.IndexInput} and | |
{@link Lucene.Net.Store.IndexOutput}. | |
<p /><b>NOTE:</b> this class assumes the stored integers are doc Ids (hence why it | |
extends {@link DocIdSet}). Therefore its {@link #Iterator()} assumes {@link | |
DocIdSetIterator#NO_MORE_DOCS} can be used as sentinel. If you intent to use | |
this value, then make sure it's not used during search flow. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="b2c358c5-e8ae-bfc9-107e-a05cd9229a09.htm">SorterTemplate</a></td><td><div class="summary"> Borrowed from Cglib. Allows custom swap so that two arrays can be sorted | |
at the same time. | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="c83c7f7e-cf2d-2719-8b60-1ba07479979c.htm">StringHelper</a></td><td><div class="summary"> Methods for manipulating strings. | |
$Id: StringHelper.java 801344 2009-08-05 18:05:06Z yonik $ | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="95c63c47-66aa-8715-0616-09d77bc1e62e.htm">StringInterner</a></td><td><div class="summary"> Subclasses of StringInterner are required to | |
return the same single String object for all equal strings. | |
Depending on the implementation, this may not be | |
the same object returned as String.intern(). | |
This StringInterner base class simply delegates to String.intern(). | |
</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="8cac4327-16bb-1a9c-8dae-b074457f6bc2.htm">ToStringUtils</a></td><td><div class="summary"> Helper methods to ease implementing {@link Object#toString()}.</div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="053f93c8-d80b-ebbb-3036-95d307d99888.htm">UnicodeUtil</a></td><td><div class="summary"> Class to encode java's UTF16 char[] into UTF8 byte[] | |
without always allocating a new byte[] as | |
String.getBytes("UTF-8") does. | |
<p /><b>WARNING</b>: This API is a new and experimental and | |
may suddenly change. <p /></div></td></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="d8e20a04-8870-98e1-d0e0-b0b72c69978a.htm">UnicodeUtil<span class="languageSpecificText"><span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span><span class="fs">.</span></span>UTF16Result</a></td><td /></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="49826129-bb54-b0fc-02e9-030dc93bd4da.htm">UnicodeUtil<span class="languageSpecificText"><span class="cs">.</span><span class="vb">.</span><span class="cpp">::</span><span class="nu">.</span><span class="fs">.</span></span>UTF8Result</a></td><td /></tr><tr data="class; public"><td><img src="../icons/pubclass.gif" alt="Public class" title="Public class" /></td><td><a href="41fa2e7f-d93d-69ec-8971-a2bc64cdbe10.htm">Version</a></td><td><div class="summary"> Use by certain classes to match version compatibility | |
across releases of Lucene. | |
<p /><b>WARNING</b>: When changing the version parameter | |
that you supply to components in Lucene, do not simply | |
change the version at search-time, but instead also adjust | |
your indexing code to match, and re-index. | |
</div></td></tr></table></div><h1 class="heading"><span onclick="ExpandCollapse(interfaceToggle)" style="cursor:default;" onkeypress="ExpandCollapse_CheckKey(interfaceToggle, event)" tabindex="0"><img id="interfaceToggle" class="toggle" name="toggleSwitch" src="../icons/collapse_all.gif" />Interfaces</span></h1><div id="interfaceSection" class="section" name="collapseableSection" style=""><table id="typeList" class="members" frame="lhs" cellpadding="2"><col width="10%" /><tr><th class="iconColumn"> | |
</th><th class="nameColumn">Interface</th><th class="descriptionColumn">Description</th></tr><tr data="interface; public"><td><img src="../icons/pubinterface.gif" alt="Public interface" title="Public interface" /></td><td><a href="57230ee6-d042-f90f-169e-d598df2cc692.htm">Attribute</a></td><td><div class="summary"> Base interface for attributes.</div></td></tr></table></div></div><div id="footer"><div class="footerLine"><img width="100%" height="3px" src="../icons/footer.gif" alt="Footer image" title="Footer image" /></div><A NAME="feedback"></A><span id="fb" class="feedbackcss"></span></div></div></body></html> |