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 ofAttributeSource
orAttributeImpl
.An AttributeSource contains a list of differentAttributeImpl
s, and methods to add and get them.An AttributeFactory creates instances ofAttributeImpl
s.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 along
algorithm 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.Allocator
that never recycles.A simpleByteBlockPool.Allocator
that never recycles, but tracks how much total RAM is in use.Represents byte[], as a slice (offset + length) into an existing byte[].BytesRefHash
is a special purpose hash-map like data-structure optimized forBytesRef
instances.Manages allocation of the per-term addresses.A simpleBytesRefHash.BytesStartArray
that tracks memory allocation using a privateCounter
instance.A simple iterator interface forBytesRef
iteration.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.AnIterator
implementation that filters elements with a boolean predicate.BitSet of fixed length (numBits), backed by accessible (FixedBitSet.getBits()
) long[], accessed with an int index, implementingBits
andDocIdSet
.ADocIdSetIterator
which iterates over set bits in aFixedBitSet
.ADataOutput
that can be used to build a byte[].Deprecated.Debugging API for Lucene classes such asIndexWriter
andSegmentInfos
.Sorter
implementation based on the merge-sort algorithm that merges in place (no extra memory will be allocated).A pool for int blocks similar toByteBlockPool
Abstract class for allocating and freeing int blocks.A simpleIntBlockPool.Allocator
that never recycles.AIntBlockPool.SliceReader
that can read int slices written by aIntBlockPool.SliceWriter
AIntBlockPool.SliceWriter
that 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 defaultThreadFactory
implementation 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.DocIdSet
implementation based on pfor-delta encoding.A builder forPForDeltaDocIdSet
.InfoStream implementation over aPrintStream
such 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 theAnalyzer
chain.Estimates the size (memory representation) of Java objects.JVM diagnostic features.AByteBlockPool.Allocator
implementation that recycles unused byte blocks in a buffer and reuses them in subsequent calls toRecyclingByteBlockAllocator.getByteBlock()
.AIntBlockPool.Allocator
implementation 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).DocIdSet
implementation based on word-aligned hybrid encoding on words of 8 bits.A builder forWAH8DocIdSet
s.WeakIdentityMap<K,V> Implements a combination ofWeakHashMap
andIdentityHashMap
.
TermToBytesRefAttribute
and store bytes directly instead.