Some utility classes.
Interface Summary Interface Description AttributeBase interface for attributes. AttributeReflector BitsInterface for Bitset-like structures. BytesRefIteratorA simple iterator interface for
MutableBitsExtension of Bits for live documents. NamedSPILoader.NamedSPIInterface to support
RollingBuffer.ResettableImplement to reset an instance
Class Summary Class Description ArrayUtilMethods for manipulating arrays. AttributeImplBase class for Attributes that can be added to a
AttributeSourceAn AttributeSource contains a list of different
AttributeImpls, and methods to add and get them.
AttributeSource.AttributeFactoryAn AttributeFactory creates instances of
AttributeSource.StateThis class holds the state of an AttributeSource. Bits.MatchAllBitsBits impl of the specified length with all bits set. Bits.MatchNoBitsBits impl of the specified length with no bits set. BitUtilA variety of high efficiency bit twiddling routines. BroadWordMethods 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 a
BroadWord.select(long, int), selection of a set bit in a
long, bytewise signed smaller <8 operator:
ByteBlockPoolClass that Posting and PostingVector use to write byte streams into shared fixed-size byte arrays. ByteBlockPool.AllocatorAbstract class for allocating and freeing byte blocks. ByteBlockPool.DirectAllocatorA simple
ByteBlockPool.Allocatorthat never recycles.
ByteBlockPool.Allocatorthat never recycles, but tracks how much total RAM is in use.
BytesRefRepresents byte, as a slice (offset + length) into an existing byte. BytesRefHash BytesRefHash.BytesStartArrayManages allocation of the per-term addresses. BytesRefHash.DirectBytesStartArray CharsRefRepresents char, as a slice (offset + length) into an existing char. CloseableThreadLocal<T>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. CollectionUtilMethods for manipulating (sorting) collections. CommandLineUtilClass containing some useful methods used by command line tools ConstantsSome useful constants. CounterSimple counter class DocIdBitSetSimple DocIdSet and DocIdSetIterator backed by a BitSet DoubleBarrelLRUCache<K extends DoubleBarrelLRUCache.CloneableKey,V>Simple concurrent LRU cache, using a "double barrel" approach where two ConcurrentHashMaps record entries. DoubleBarrelLRUCache.CloneableKeyObject providing clone(); the key class must subclass this. FieldCacheSanityCheckerProvides methods for sanity checking that entries in the FieldCache are not wasteful or inconsistent. FieldCacheSanityChecker.InsanitySimple container for a collection of related CacheEntry objects that in conjunction with each other represent some "insane" usage of the FieldCache. FieldCacheSanityChecker.InsanityTypeAn Enumeration of the different types of "insane" behavior that may be detected in a FieldCache. FilterIterator<T>An
Iteratorimplementation that filters elements with a boolean predicate.
FixedBitSet FixedBitSet.FixedBitSetIterator GrowableByteArrayDataOutputA
DataOutputthat can be used to build a byte.
TermToBytesRefAttributeand store bytes directly instead.
Sorterimplementation based on the merge-sort algorithm that merges in place (no extra memory will be allocated).
IntBlockPoolA pool for int blocks similar to
IntBlockPool.AllocatorAbstract class for allocating and freeing int blocks. IntBlockPool.DirectAllocatorA simple
IntBlockPool.Allocatorthat never recycles.
IntBlockPool.SliceReader IntBlockPool.SliceWriter IntroSorter IntsRefRepresents int, as a slice (offset + length) into an existing int. IOUtilsThis class emulates the new Java 7 "Try-With-Resources" statement. LongBitSetBitSet of fixed length (numBits), backed by accessible (
LongBitSet.getBits()) long, accessed with a long index.
LongsRefRepresents long, as a slice (offset + length) into an existing long. LongValuesAbstraction over an array of longs. MapOfSets<K,V>Helper class for keeping Lists of Objects associated with keys. MathUtilMath static utility methods. MergedIterator<T extends Comparable<T>>Provides a merged sorted view from several sorted iterators. NamedSPILoader<S extends NamedSPILoader.NamedSPI>Helper class for loading named SPIs from classpath (e.g. NamedThreadFactoryA default
ThreadFactoryimplementation that accepts the name prefix of the created threads as a constructor argument.
NumericUtilsThis is a helper class to generate prefix-encoded representations for numerical values and supplies converters to represent float/double values as sortable integers/longs. NumericUtils.IntRangeBuilder NumericUtils.LongRangeBuilder OpenBitSetAn "open" BitSet implementation that allows direct access to the array of words storing the bits. OpenBitSetDISIOpenBitSet with added methods to bulk-update the bits from a
OpenBitSetIteratorAn iterator to iterate over set bits in an OpenBitSet. PagedBytesRepresents a logical byte as a series of pages. PagedBytes.ReaderProvides methods to read BytesRefs from a frozen PagedBytes. PForDeltaDocIdSet
DocIdSetimplementation based on pfor-delta encoding.
PForDeltaDocIdSet.BuilderA builder for
PrintStreamInfoStreamInfoStream implementation over a
PriorityQueue<T>A PriorityQueue maintains a partial ordering of its elements such that the least element can always be found in constant time. QueryBuilderCreates queries from the
RamUsageEstimatorEstimates the size (memory representation) of Java objects. RecyclingByteBlockAllocator RecyclingIntBlockAllocator 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. SentinelIntSetA 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. SloppyMathMath functions that trade off accuracy for speed. SmallFloatFloating point numbers smaller than 32 bits. SorterBase class for sorting algorithms implementations. SPIClassIterator<S>Helper class for loading SPI classes from classpath (META-INF files). StringHelperMethods for manipulating strings. TimSorter ToStringUtilsHelper methods to ease implementing
UnicodeUtilClass to encode java's UTF16 char into UTF8 byte without always allocating a new byte as String.getBytes("UTF-8") does. VirtualMethod<C>A utility for keeping backwards compatibility on previously abstract methods (or similar replacements). WAH8DocIdSet
DocIdSetimplementation based on word-aligned hybrid encoding on words of 8 bits.
WAH8DocIdSet.BuilderA builder for
Enum Summary Enum Description RamUsageEstimator.JvmFeatureJVM diagnostic features. VersionUse by certain classes to match version compatibility across releases of Lucene.
Exception Summary Exception Description BytesRefHash.MaxBytesLengthExceededException SetOnce.AlreadySetExceptionThrown when
SetOnce.set(Object)is called more than once.
ThreadInterruptedExceptionThrown by lucene on detecting that Thread.interrupt() had been called.