Package org.apache.lucene.util
package org.apache.lucene.util
Some utility classes.
-
ClassDescriptionMethods for manipulating arrays.Base interface for attributes.Base class for Attributes that can be added to a
AttributeSource.This interface is used to reflect contents ofAttributeSourceorAttributeImpl.An AttributeSource contains a list of differentAttributeImpls, and methods to add and get them.An AttributeFactory creates instances ofAttributeImpls.This class holds the state of an AttributeSource.Interface for Bitset-like structures.Bits impl of the specified length with all bits set.Bits impl of the specified length with no bits set.A variety of high efficiency bit twiddling routines.Methods and constants inspired by the article "Broadword Implementation of Rank/Select Queries" by Sebastiano Vigna, January 30, 2012: algorithm 1:BroadWord.bitCount(long), count of set bits in alongalgorithm 2:BroadWord.select(long, int), selection of a set bit in along, bytewise signed smaller <8 operator:BroadWord.smallerUpTo7_8(long,long).Class that Posting and PostingVector use to write byte streams into shared fixed-size byte[] arrays.Abstract class for allocating and freeing byte blocks.A simpleByteBlockPool.Allocatorthat never recycles.A simpleByteBlockPool.Allocatorthat never recycles, but tracks how much total RAM is in use.Represents byte[], as a slice (offset + length) into an existing byte[].BytesRefHashis a special purpose hash-map like data-structure optimized forBytesRefinstances.Manages allocation of the per-term addresses.A simpleBytesRefHash.BytesStartArraythat tracks memory allocation using a privateCounterinstance.A simple iterator interface forBytesRefiteration.Represents char[], as a slice (offset + length) into an existing char[].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.Methods for manipulating (sorting) collections.Class containing some useful methods used by command line toolsSome useful constants.Simple counter classSimple DocIdSet and DocIdSetIterator backed by a BitSetSimple concurrent LRU cache, using a "double barrel" approach where two ConcurrentHashMaps record entries.Object providing clone(); the key class must subclass this.Provides methods for sanity checking that entries in the FieldCache are not wasteful or inconsistent.Simple container for a collection of related CacheEntry objects that in conjunction with each other represent some "insane" usage of the FieldCache.An Enumeration of the different types of "insane" behavior that may be detected in a FieldCache.AnIteratorimplementation that filters elements with a boolean predicate.BitSet of fixed length (numBits), backed by accessible (FixedBitSet.getBits()) long[], accessed with an int index, implementingBitsandDocIdSet.ADocIdSetIteratorwhich iterates over set bits in aFixedBitSet.ADataOutputthat can be used to build a byte[].Deprecated.Debugging API for Lucene classes such asIndexWriterandSegmentInfos.Sorterimplementation based on the merge-sort algorithm that merges in place (no extra memory will be allocated).A pool for int blocks similar toByteBlockPoolAbstract class for allocating and freeing int blocks.A simpleIntBlockPool.Allocatorthat never recycles.AIntBlockPool.SliceReaderthat can read int slices written by aIntBlockPool.SliceWriterAIntBlockPool.SliceWriterthat allows to write multiple integer slices into a givenIntBlockPool.Represents int[], as a slice (offset + length) into an existing int[].This class emulates the new Java 7 "Try-With-Resources" statement.BitSet of fixed length (numBits), backed by accessible (LongBitSet.getBits()) long[], accessed with a long index.Represents long[], as a slice (offset + length) into an existing long[].Abstraction over an array of longs.MapOfSets<K,V> Helper class for keeping Lists of Objects associated with keys.Math static utility methods.MergedIterator<T extends Comparable<T>>Provides a merged sorted view from several sorted iterators.Extension of Bits for live documents.NamedSPILoader<S extends NamedSPILoader.NamedSPI>Helper class for loading named SPIs from classpath (e.g.Interface to supportNamedSPILoader.lookup(String)by name.A defaultThreadFactoryimplementation that accepts the name prefix of the created threads as a constructor argument.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.An "open" BitSet implementation that allows direct access to the array of words storing the bits.OpenBitSet with added methods to bulk-update the bits from aDocIdSetIterator.An iterator to iterate over set bits in an OpenBitSet.Represents a logical byte[] as a series of pages.Provides methods to read BytesRefs from a frozen PagedBytes.DocIdSetimplementation based on pfor-delta encoding.A builder forPForDeltaDocIdSet.InfoStream implementation over aPrintStreamsuch asSystem.out.A PriorityQueue maintains a partial ordering of its elements such that the least element can always be found in constant time.Creates queries from theAnalyzerchain.Estimates the size (memory representation) of Java objects.JVM diagnostic features.AByteBlockPool.Allocatorimplementation that recycles unused byte blocks in a buffer and reuses them in subsequent calls toRecyclingByteBlockAllocator.getByteBlock().AIntBlockPool.Allocatorimplementation that recycles unused int blocks in a buffer and reuses them in subsequent calls toRecyclingIntBlockAllocator.getIntBlock().RefCount<T>Manages reference counting for a given object.RollingBuffer<T extends RollingBuffer.Resettable>Acts like forever growing T[], but internally uses a circular buffer to reuse instances of T.Implement to reset an instanceA native int hash-based set where one value is reserved to mean "EMPTY" internally.SetOnce<T>A convenient class which offers a semi-immutable object wrapper implementation which allows one to set the value of an object exactly once, and retrieve it many times.Thrown whenSetOnce.set(Object)is called more than once.Math functions that trade off accuracy for speed.Floating point numbers smaller than 32 bits.Base class for sorting algorithms implementations.Helper class for loading SPI classes from classpath (META-INF files).Methods for manipulating strings.Thrown by lucene on detecting that Thread.interrupt() had been called.Helper methods to ease implementingObject.toString().Class to encode java's UTF16 char[] into UTF8 byte[] without always allocating a new byte[] as String.getBytes("UTF-8") does.Use by certain classes to match version compatibility across releases of Lucene.A utility for keeping backwards compatibility on previously abstract methods (or similar replacements).DocIdSetimplementation based on word-aligned hybrid encoding on words of 8 bits.A builder forWAH8DocIdSets.WeakIdentityMap<K,V> Implements a combination ofWeakHashMapandIdentityHashMap.
TermToBytesRefAttributeand store bytes directly instead.