Package-level declarations

Types

Link copied to clipboard

port of java.util.concurrent.AbstractExecutorService

Link copied to clipboard

A synchronizer that may be exclusively owned by a thread. This class provides a basis for creating locks and related synchronizers that may entail a notion of ownership. The AbstractOwnableSynchronizer class itself does not manage or use this information. However, subclasses and tools may use appropriately maintained values to help control and monitor access and provide diagnostics.

Link copied to clipboard
abstract class AbstractQueue<E> : AbstractCollection<E> , Queue<E>

This class provides skeletal implementations of some Queue operations. The implementations in this class are appropriate when the base implementation does not allow null elements. Methods .add, .remove, and .element are based on .offer, .poll, and .peek, respectively, but throw exceptions instead of indicating failure via false or null returns.

Link copied to clipboard

Provides a framework for implementing blocking locks and related synchronizers (semaphores, events, etc) that rely on first-in-first-out (FIFO) wait queues. This class is designed to be a useful basis for most kinds of synchronizers that rely on a single atomic int value to represent state. Subclasses must define the protected methods that change this state, and which define what that state means in terms of this object being acquired or released. Given these, the other methods in this class carry out all queuing and blocking mechanics. Subclasses can maintain other state fields, but only the atomically updated int value manipulated using methods .getState, .setState and .compareAndSetState is tracked with respect to synchronization.

Link copied to clipboard

Port of java.nio.file.AccessDeniedException.

Link copied to clipboard
object Arrays
Link copied to clipboard
Link copied to clipboard

Checked exception received by a thread when another thread closes the channel or the part of the channel upon which it is blocked in an I/O operation.

Link copied to clipboard
Link copied to clipboard

port of java.nio.file.AtomicMoveNotSupportedException

Link copied to clipboard

This class implements a vector of bits that grows as needed. Each component of the bit set has a boolean value. The bits of a BitSet are indexed by nonnegative integers. Individual indexed bits can be examined, set, or cleared. One BitSet may be used to modify the contents of another BitSet through logical AND, logical inclusive OR, and logical exclusive OR operations.

Link copied to clipboard
interface BlockingQueue<E> : Queue<E>

port of java.util.concurrent.BlockingQueue

Link copied to clipboard
abstract class BreakIterator : Cloneable<Any>

The BreakIterator class implements methods for finding the location of boundaries in text. Instances of BreakIterator maintain a current position and scan over text returning the index of characters where boundaries occur. Internally, BreakIterator scans text using a CharacterIterator, and is thus able to scan text held by any object implementing that protocol. A StringCharacterIterator is used to scan String objects passed to setText.

Link copied to clipboard

An abstract class for service providers that provide concrete implementations of the java.text.BreakIterator class.

Link copied to clipboard

Concrete implementation of the java.text.spi.BreakIteratorProvider class for the JRE LocaleProviderAdapter.

Link copied to clipboard

Port of java.util.concurrent.BrokenBarrierException.

Link copied to clipboard
open class BufferedInputStream @JvmOverloads constructor(in: InputStream, size: Int = DEFAULT_BUFFER_SIZE) : FilterInputStream

A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the input and to support the mark and reset methods. When the BufferedInputStream is created, an internal buffer array is created. As bytes from the stream are read or skipped, the internal buffer is refilled as necessary from the contained input stream, many bytes at a time. The mark operation remembers a point in the input stream and the reset operation causes all the bytes read since the most recent mark operation to be reread before new bytes are taken from the contained input stream.

Link copied to clipboard

port of java.io.BufferedOutputStream

Link copied to clipboard
open class BufferedReader @JvmOverloads constructor(in: Reader, sz: Int = DEFAULT_CHAR_BUFFER_SIZE) : Reader

Reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.

Link copied to clipboard
open class BufferedWriter : Writer

port of java.io.BufferedWriter

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class ByteArrayInputStream(buf: ByteArray, offset: Int = 0, length: Int = buf.size - offset) : InputStream

A ByteArrayInputStream contains an internal buffer that contains bytes that may be read from the stream. An internal counter keeps track of the next byte to be supplied by the read method.

Link copied to clipboard

This class implements an output stream in which the data is written into a byte array. The buffer automatically grows as data is written to it. The data can be retrieved using toByteArray() and toString().

Link copied to clipboard
Link copied to clipboard

A channel that can read and write bytes. This interface simply unifies ReadableByteChannel and WritableByteChannel; it does not specify any new operations.

Link copied to clipboard
class ByteOrder

ported from java.nio.ByteOrder

Link copied to clipboard
fun interface Callable<T>

Function interface to replace java.util.concurrent.Callable

Link copied to clipboard
interface Channel : Closeable

A nexus for I/O operations.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

This interface defines a protocol for bidirectional iteration over text. The iterator iterates over a bounded sequence of characters. Characters are indexed with values beginning with the value returned by getBeginIndex() and continuing through the value returned by getEndIndex()-1.

Link copied to clipboard
abstract class Charset : Comparable<Charset>

A minimal multiplatform dummy port of java.nio.charset.Charset. This implementation supports only UTF-8.

Link copied to clipboard
abstract class CharsetDecoder(cs: Charset, averageCharsPerByte: Float, maxCharsPerByte: Float, replacement: String)

An engine that can transform a sequence of bytes in a specific charset into a sequence of sixteen-bit Unicode characters.

Link copied to clipboard
abstract class CharsetEncoder

An engine that can transform a sequence of sixteen-bit Unicode characters into a sequence of bytes in a specific charset.

Link copied to clipboard

An output stream that also maintains a checksum of the data being written. The checksum can then be used to verify the integrity of the output data.

Link copied to clipboard
interface Checksum

An interface representing a data checksum.

Link copied to clipboard

No-op classloader for Kotlin Multiplatform. Mimics java.lang.ClassLoader

Link copied to clipboard
interface Cloneable<T>

A multiplatform-friendly clone interface. Unlike Java’s Cloneable, this interface declares a clone function that returns a copy.

Link copied to clipboard
interface Closeable

A Closeable is a source or destination of data that can be closed. The close method is invoked to release resources that the object is holding (such as open files).

Link copied to clipboard

Checked exception received by a thread when another thread interrupts it while it is blocked in an I/O operation upon a channel. Before this exception is thrown the channel will have been closed and the interrupt status of the previously-blocked thread will have been set.

Link copied to clipboard
open class ClosedChannelException : IOException

Checked exception thrown when an attempt is made to invoke or complete an I/O operation upon channel that is closed, or at least closed to that operation. That this exception is thrown does not necessarily imply that the channel is completely closed. A socket channel whose write half has been shut down, for example, may still be open for reading.

Link copied to clipboard

Error thrown when the decodeLoop method of a CharsetDecoder, or the encodeLoop method of a CharsetEncoder, throws an unexpected exception.

Link copied to clipboard

A description of the result state of a coder.

Link copied to clipboard

A typesafe enumeration for coding-error actions.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface CompletionService<V>

A service that decouples the production of new asynchronous tasks from the consumption of the results of completed tasks. Producers submit tasks for execution. Consumers take completed tasks and process their results in the order they complete. A CompletionService can for example be used to manage asynchronous I/O, in which tasks that perform reads are submitted in one part of a program or system, and then acted upon in a different part of the program when the reads complete, possibly in a different order than they were requested.

Link copied to clipboard
interface Condition

Condition factors out the Object monitor methods (Object.wait, Object.notify and Object.notifyAll) into distinct objects to give the effect of having multiple wait-sets per object, by combining them with the use of arbitrary Lock implementations. Where a Lock replaces the use of synchronized methods and statements, a Condition replaces the use of the Object monitor methods.

Link copied to clipboard
fun interface Consumer<T>

port of java.util.function.Consumer

Link copied to clipboard
interface CopyOption

port of java.nio.file.CopyOption

Link copied to clipboard
interface CoroutineRunnable : Runnable

Optional extension for Runnables that can run cooperatively in a coroutine. If a Runnable also implements this, ThreadFactory implementations may invoke runSuspending inside a coroutine rather than calling Runnable.run, avoiding nested runBlocking and enabling proper cancellation/wakeups.

Link copied to clipboard
class CountDownLatch(count: Int)
Link copied to clipboard
class CP1251 : Charset

Windows-1251 (CP1251) charset.

Link copied to clipboard
class CRC32 : Checksum

A Kotlin common implementation of CRC32.

Link copied to clipboard
class CyclicBarrier(parties: Int, barrierAction: Runnable? = null)

Port of java.util.concurrent.CyclicBarrier.

Link copied to clipboard

ported from java.util.zip.DataFormatException

Link copied to clipboard

placeholder for java.text.DecimalFormat which is used in org.gnit.lucenekmp.util.RamUsageEstimator org.gnit.lucenekmp.util.RamUsageEstimator does not use this but it is kept here for porting progress script to mark the class ported

Link copied to clipboard

A subclass of RuleBasedBreakIterator that adds the ability to use a dictionary to further subdivide ranges of text beyond what is possible using just the state-table-based algorithm. This is necessary, for example, to handle word and line breaking in Thai, which doesn't use spaces between words. The state-table-based algorithm used by RuleBasedBreakIterator is used to divide up text as far as possible, and then contiguous ranges of letters are repeatedly compared against a list of known words (i.e., the dictionary) to divide them up into words.

Link copied to clipboard

ported from jdk.internal.math.DoubleConsts

Link copied to clipboard
abstract class EnumSet<E : Enum<E>>(elementType: KClass<E>, universe: Array<Enum<E>>) : AbstractMutableSet<E> , Cloneable<EnumSet<E>>

A specialized Set implementation for use with enum types. All of the elements in an enum set must come from a single enum type that is specified, explicitly or implicitly, when the set is created. Enum sets are represented internally as bit vectors. This representation is extremely compact and efficient. The space and time performance of this class should be good enough to allow its use as a high-quality, typesafe alternative to traditional int-based "bit flags." Even bulk operations (such as containsAll and retainAll) should run very quickly if their argument is also an enum set.

Link copied to clipboard
class ExecutionException(cause: Throwable? = null) : Exception

Exception to replace java.util.concurrent.ExecutionException

Link copied to clipboard
fun interface Executor

Function interface to replace java.util.concurrent.Executor

Link copied to clipboard

A CompletionService that uses a supplied Executor to execute tasks. This class arranges that submitted tasks are, upon completion, placed on a queue accessible using take. The class is lightweight enough to be suitable for transient use when processing groups of tasks.

Link copied to clipboard
object Executors
Link copied to clipboard

port of java.util.concurrent.ExecutorService

Link copied to clipboard
object FdLibm

Port of the "Freely Distributable Math Library", version 5.3, from C to Java. Then port from Java to Kotlin Multiplatform for lucene-kmp.

Link copied to clipboard
class Field
Link copied to clipboard

port of java.nio.file.FileAlreadyExistsException

Link copied to clipboard
object Files

port of java.nio.file.Files

Link copied to clipboard
open class FileSystemException : IOException

Thrown when a file system operation fails on one or two files. This class is the general class for file system exceptions.

Link copied to clipboard

port of java.io.FilterInputStream

Link copied to clipboard

This class is the superclass of all classes that filter output streams. These streams sit on top of an already existing output stream (the underlying output stream) which it uses as its basic sink of data, but possibly transforming the data along the way or providing additional functionality.

Link copied to clipboard
class FloatBuffer(buffer: Buffer, val capacity: Int, baseOffset: Long = 0) : Comparable<FloatBuffer>

ported from java.nio.FloatBuffer

Link copied to clipboard
Link copied to clipboard
interface Flushable

port of java.io.Flushable

Link copied to clipboard
Link copied to clipboard
interface Future<T>

Interface to replace java.util.concurrent.Future

Link copied to clipboard
open class FutureTask<V> : RunnableFuture<V>

A cancellable asynchronous computation. This class provides a base implementation of Future, with methods to start and cancel a computation, query to see if the computation is complete, and retrieve the result of the computation. The result can only be retrieved when the computation has completed; the get methods will block if the computation has not yet completed. Once the computation has completed, the computation cannot be restarted or cancelled (unless the computation is invoked using runAndReset).

Link copied to clipboard
class GB2312 : Charset

GB2312 charset (EUC-CN repertoire).

Link copied to clipboard
object Grapheme
Link copied to clipboard
Link copied to clipboard

port of java.net.Inet4Address

Link copied to clipboard

port of java.net.Inet6Address

Link copied to clipboard
abstract class InetAddress

minimum implementation to support usage in lucene

Link copied to clipboard
class InetSocketAddress(val hostname: String, val port: Int)
Link copied to clipboard
open class InputSource

A single input source for an XML entity.

Link copied to clipboard
abstract class InputStream : AutoCloseable

This abstract class is the superclass of all classes representing an input stream of bytes.

Link copied to clipboard

port of InputStreamReader

Link copied to clipboard
class IntBuffer(buffer: Buffer, val capacity: Int, baseOffset: Long = 0) : Comparable<IntBuffer>

A platform-agnostic IntBuffer built on top of a kotlin‑io Buffer.

Link copied to clipboard

Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity. Occasionally a method may wish to test whether the current thread has been interrupted, and if so, to immediately throw this exception. The following code can be used to achieve this effect: {@snippet lang=java :

Link copied to clipboard

A channel that can be asynchronously closed and interrupted.

Link copied to clipboard
open class IOError(cause: Throwable) : Error

Port of java.io.IOError.

Link copied to clipboard

port of sun.net.util.IPAddressUtil

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract class KClassValue<T : Any>

port of java.lang.ClassValue

Link copied to clipboard
class KIOSourceBufferedReader(source: BufferedSource, bufferSize: Int = DEFAULT_BUFFER_SIZE) : Reader

Multiplatform buffered character reader that mirrors the API of Java's BufferedReader:contentReferenceoaicite:0{index=0}. It reads text from a Source (byte stream) and buffers characters to provide efficient reading of single characters, arrays, and lines:contentReferenceoaicite:1{index=1}. The buffer size may be specified, or a default size (8192) is used, which is large enough for most purposes:contentReferenceoaicite:2{index=2}.

Link copied to clipboard
interface KmpSink
Link copied to clipboard

A buffered character-input stream that keeps track of line numbers. This class defines methods .setLineNumber and .getLineNumber for setting and getting the current line number respectively.

Link copied to clipboard
open class LinkageError : Error
Link copied to clipboard
open class LinkedBlockingQueue<E>(capacity: Int = Int.MAX_VALUE) : AbstractQueue<E> , BlockingQueue<E>
Link copied to clipboard
class Locale(val language: String? = null, val country: String? = null, val variant: String? = null)

ported to keep API surface compatible with Java lucene However, as I ever know, only QueryParserBase and some class are using Locale for the purpose of generating RangeQuery and Locale is used to feed DateFormat to get date instance. This operation can be ignored as we can implement equivalent without using Locale.

Link copied to clipboard
abstract class LocaleProviderAdapter

The LocaleProviderAdapter abstract class.

Link copied to clipboard
abstract class LocaleServiceProvider

This is the super class of all the locale sensitive service provider interfaces (SPIs).

Link copied to clipboard
interface Lock

Lock implementations provide more extensive locking operations than can be obtained using synchronized methods and statements. They allow more flexible structuring, may have quite different properties, and may support multiple associated Condition objects.

Link copied to clipboard

Basic thread blocking primitives for creating locks and other synchronization classes.

Link copied to clipboard
class LongBuffer(buffer: Buffer, val capacity: Int, baseOffset: Long = 0) : Comparable<LongBuffer>

A platform-agnostic LongBuffer built on top of a kotlin‑io Buffer.

Link copied to clipboard

ported from java.nio.charset.MalformedInputException

Link copied to clipboard
object Math
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface NavigableMap<K, V> : SortedMap<K, V>

A SortedMap extended with navigation methods returning the closest matches for given search targets. Methods .lowerEntry, .floorEntry, .ceilingEntry, and .higherEntry return Map.Entry objects associated with keys respectively less than, less than or equal, greater than or equal, and greater than a given key, returning null if there is no such key. Similarly, methods .lowerKey, .floorKey, .ceilingKey, and .higherKey return only the associated keys. All of these methods are designed for locating, not traversing entries.

Link copied to clipboard
interface NavigableSet<E> : SortedSet<E>

A SortedSet extended with navigation methods reporting closest matches for given search targets. Methods .lower, .floor, .ceiling, and .higher return elements respectively less than, less than or equal, greater than or equal, and greater than a given element, returning null if there is no such element.

Link copied to clipboard

port of java.nio.file.NoSuchFileException

Link copied to clipboard

An immutable container for a key and a value, both of which are nullable.

Link copied to clipboard
object Objects

partial port of java.util.Objects

Link copied to clipboard

A OutputStream implementation which uses either okio.Sink or okio.Buffer

Link copied to clipboard
class OkioSourceInputStream(val source: BufferedSource) : InputStream

A InputStream implementation which use okio.Source

Link copied to clipboard
interface OpenOption

port of java.nio.file.OpenOption

Link copied to clipboard
class Optional<T>

A container object which may or may not contain a non-null value. If a value is present, isPresent() returns true. If no value is present, the object is considered empty and isPresent() returns false.

Link copied to clipboard
open class OutOfMemoryError : Error
Link copied to clipboard

port of java.io.OutputStream

Link copied to clipboard

port of java.io.OutputStreamWriter

Link copied to clipboard
class ParseException(message: String, val errorOffset: Int) : Exception

ported from java.text.ParseException

Link copied to clipboard
annotation class Ported(val from: String)

Annotation to indicate that a JDK class used by Java Lucene but no equivalent found in kotlin sdk. Also, classes from com.carrotsearch.randomizedtesting.* library

Link copied to clipboard

A base type for primitive specializations of Iterator. Specialized subtypes are provided for int, long, and double values.

Link copied to clipboard
open class PrintStream(autoFlush: Boolean = false, out: OutputStream) : FilterOutputStream

caution: only minimum functionality which is called by lucene is implemented

Link copied to clipboard
class PrintWriter(val out: Writer) : Writer

minimum port of java.io.PrintWriter just to make it work in lucene-kmp

Link copied to clipboard
Link copied to clipboard
interface PrivilegedAction<T>

Placeholder for java.security.PrivilegedAction.

Link copied to clipboard

Port of java.nio.file.ProviderMismatchException.

Link copied to clipboard
interface Queue<E> : MutableCollection<E>

port of java.util.Queue

Link copied to clipboard
interface Readable
Link copied to clipboard

A channel that can read bytes.

Link copied to clipboard
abstract class Reader : Readable, AutoCloseable

A minimal multiplatform abstraction for reading characters. This class mimics many of the core methods of java.io.Reader, but only those that you really need.

Link copied to clipboard
Link copied to clipboard
expect class ReentrantLock : Lock

Port of java.util.concurrent.locks.ReentrantLock.

Link copied to clipboard
open class Reference<T>(referent: T?, var queue: ReferenceQueue<T>? = (ReferenceQueue.NULL as ReferenceQueue<T>?))

A simple mimic of java.lang.ref.Reference.

Link copied to clipboard
open class ReferenceQueue<T>

A simple mimic of Java's java.lang.ref.ReferenceQueue.

Link copied to clipboard
class RegularEnumSet<E : Enum<E>>(elementType: KClass<E>, universe: Array<Enum<E>>) : EnumSet<E>

Private implementation class for EnumSet, for "regular sized" enum types (i.e., those with 64 or fewer enum constants).

Link copied to clipboard

port of java.util.concurrent.RejectedExecutionException

Link copied to clipboard

A handler for tasks that cannot be executed by a ThreadPoolExecutor.

Link copied to clipboard

A subclass of BreakIterator whose behavior is specified using a list of rules.

Link copied to clipboard
interface RunnableFuture<T> : Future<T> , Runnable

Interface to replace java.util.concurrent.RunnableFuture

Link copied to clipboard

A byte channel that maintains a current position and allows the position to be changed.

Link copied to clipboard
class Semaphore(permits: Int)

Minimal common-code port of java.util.concurrent.Semaphore used by tests/utilities.

Link copied to clipboard

A collection that has a well-defined encounter order, that supports operations at both ends, and that is reversible. The elements of a sequenced collection have an encounter order, where conceptually the elements have a linear arrangement from the first element to the last element. Given any two elements, one element is either before (closer to the first element) or after (closer to the last element) the other element.

Link copied to clipboard
interface SequencedMap<K, V> : MutableMap<K, V>

A Map that has a well-defined encounter order, that supports operations at both ends, and that is reversible. The SequencedCollection.html#encounter of a SequencedMap is similar to that of the elements of a SequencedCollection, but the ordering applies to mappings instead of individual elements.

Link copied to clipboard

A collection that is both a SequencedCollection and a Set. As such, it can be thought of either as a Set that also has a well-defined SequencedCollection.html#encounter, or as a SequencedCollection that also has unique elements.

Link copied to clipboard

No-op ServiceLoader for Kotlin Multiplatform. Mimics java.util.ServiceLoader

Link copied to clipboard

A "shared" thread container. A shared thread container doesn't have an owner and is intended for unstructured uses, e.g. thread pools.

Link copied to clipboard
interface SortedMap<K, V> : SequencedMap<K, V>

A Map that further provides a total ordering on its keys. The map is ordered according to the natural of its keys, or by a Comparator typically provided at sorted map creation time. This order is reflected when iterating over the sorted map's collection views (returned by the entrySet, keySet and values methods). Several additional operations are provided to take advantage of the ordering. (This interface is the map analogue of SortedSet.)

Link copied to clipboard
interface SortedSet<E> : MutableSet<E> , SequencedSet<E>

A Set that further provides a total ordering on its elements. The elements are ordered using their natural, or by a Comparator typically provided at sorted set creation time. The set's iterator will traverse the set in ascending element order. Several additional operations are provided to take advantage of the ordering. (This interface is the set analogue of SortedMap.)

Link copied to clipboard
interface Spliterator<T>

An object for traversing and partitioning elements of a source. The source could be an array, a Collection, an IO channel, or a generator function.

Link copied to clipboard
Link copied to clipboard
open class StackableScope(shared: Boolean)

A stackable scope to support structured constructs. The push method is used to push a StackableScope to the current thread's scope stack. The tryPop and popForcefully methods are used to pop the StackableScope from the current thread's scope stack.

Link copied to clipboard

ported from java.nio.charset.StandardCharsets

Link copied to clipboard

port of java.nio.file.StandardCopyOption

Link copied to clipboard

port of java.nio.file.StandardOpenOption

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time. The parsing process is controlled by a table and a number of flags that can be set to various states. The stream tokenizer can recognize identifiers, numbers, quoted strings, and various comment styles.

Link copied to clipboard
object StrictMath
Link copied to clipboard

A simplified, mutable sequence of characters similar in spirit to Java’s StringBuffer.

Link copied to clipboard
class StringCharacterIterator(text: String, begin: Int, end: Int, pos: Int) : CharacterIterator

StringCharacterIterator implements the CharacterIterator protocol for a String. The StringCharacterIterator class iterates over the entire String. All constructors throw NullPointerException if text is null.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
object Surrogate

Utility class for dealing with surrogates.

Link copied to clipboard
object System

ported from java.lang.System, only contains things needed for lucenekmp

Link copied to clipboard
open class Thread : Runnable

port of java.lang.Thread

Link copied to clipboard

A container of threads.

Link copied to clipboard

This class consists exclusively of static methods to support groupings of threads.

Link copied to clipboard
interface ThreadFactory

An object that creates new threads on demand. Using thread factories removes hardwiring of calls to Thread.Thread, enabling applications to use special thread subclasses, priorities, etc.

Link copied to clipboard
open class ThreadLocal<T>

port of java.lang.ThreadLocal

Link copied to clipboard
open class ThreadPoolExecutor(corePoolSize: Int, maximumPoolSize: Int, keepAliveTime: Long, unit: TimeUnit, workQueue: BlockingQueue<Runnable>, threadFactory: ThreadFactory = Executors.defaultThreadFactory(), handler: RejectedExecutionHandler = defaultHandler) : AbstractExecutorService

An ExecutorService that executes each submitted task using one of possibly several pooled threads, normally configured using Executors factory methods.

Link copied to clipboard

Exception thrown when a blocking operation times out. Blocking operations for which a timeout is specified need a means to indicate that the timeout has occurred. For many such operations it is possible to return a value that indicates timeout; when that is not possible or desirable then TimeoutException should be declared and thrown.

Link copied to clipboard

A TimeUnit represents time durations at a given unit of granularity and provides utility methods to convert across units, and to perform timing and delay operations in these units. A TimeUnit does not maintain time information, but only helps organize and use time representations that may be maintained separately across various contexts. A nanosecond is defined as one thousandth of a microsecond, a microsecond as one thousandth of a millisecond, a millisecond as one thousandth of a second, a minute as sixty seconds, an hour as sixty minutes, and a day as twenty four hours.

Link copied to clipboard
object Timsort
Link copied to clipboard

A Red-Black tree based implementation of the MutableMap interface, striving for compatibility with the subset of TreeMap functionality potentially used by Lucene.

Link copied to clipboard

A NavigableSet implementation based on a TreeMap. The elements are ordered using their natural, or by a Comparator provided at set creation time, depending on which constructor is used.

Link copied to clipboard

Wraps an IOException with an unchecked exception.

Link copied to clipboard
abstract class Unicode(name: String, aliases: Set<String>) : Charset
Link copied to clipboard

Base class for different flavors of UTF-16 encoders

Link copied to clipboard
open class UnknownError : Error
Link copied to clipboard
class UnknownHostException : IOException

Thrown to indicate that the IP address of a host could not be determined.

Link copied to clipboard

Checked exception thrown when an input character (or byte) sequence is valid but cannot be mapped to an output byte (or character) sequence.

Link copied to clipboard
Link copied to clipboard
class UnmodifiableMutableMap<K, V>(delegate: MutableMap<K, V>) : MutableMap<K, V>
Link copied to clipboard
Link copied to clipboard

A minimal dummy exception indicating that the requested charset is not supported.

Link copied to clipboard
class UnsupportedEncodingException(message: String? = null) : IOException

The Character Encoding is not supported.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class UTF_8 : Unicode
Link copied to clipboard
object Void
Link copied to clipboard
open class WeakReference<T> : Reference<T?>
Link copied to clipboard

A channel that can write bytes.

Link copied to clipboard

Abstract class for writing to character streams. The only methods that a subclass must implement are write(char[], int, int), flush(), and close(). Most subclasses, however, will override some of the methods defined here in order to provide higher efficiency, additional functionality, or both.

Properties

Link copied to clipboard
const val COMPACT_STRINGS: Boolean = true
Link copied to clipboard

Maximum exponent a finite double variable may have. It is equal to the value returned by Math.getExponent(Double.MAX_VALUE).

Link copied to clipboard

Minimum unbiased exponent of a normalised binary-64 value (-1022).

Link copied to clipboard

A constant holding the smallest positive normal value of type float, 2-126. It is equal to the hexadecimal floating-point literal 0x1.0p-126f and also equal to Float.intBitsToFloat(0x00800000).

Link copied to clipboard

Number of explicit significand bits in a binary-64 value (53).

Link copied to clipboard
const val REPL: Char = '\ufffd'
Link copied to clipboard

The number of bits used to represent a float value.

Functions

Link copied to clipboard
fun AtomicInt.accumulateAndGet(x: Int, accumulatorFunction: (Int, Int) -> Int): Int

Atomically updates (with memory effects as specified by VarHandle.compareAndSet) the current value with the results of applying the given function to the current and given values, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument.

Link copied to clipboard

Appends the Unicode code point represented by codePoint to this StringBuilder.

Link copied to clipboard
expect inline fun assert(condition: Boolean, lazyMessage: () -> Any = { "assertion failed" })

This function had to be created because as of Kotlin 2.1.21 or around, as of May 2025 assert() function does not exist in kotlin common standard library. It exists in JVM and Native, so we will delegate to them for now. When std lib get assert in common, we will remove this function and use the std lib assert() instead.

Link copied to clipboard
fun <U : Any> KClass<U>.asSubclass(clazz: KClass<*>): KClass<U>
Link copied to clipboard

Returns the number of one-bits in the two's complement binary representation of the specified Int value. This function is sometimes referred to as the population count.

Returns the number of one-bits in the two's complement binary representation of the specified Long value. This function is sometimes referred to as the population count.

Link copied to clipboard
fun checkIndex(index: Int, length: Int)

Checks if the given index is within bounds (0 until length).

Link copied to clipboard
fun classForName(name: String, initialize: Boolean, loader: ClassLoader): KClass<*>
Link copied to clipboard

Returns the Unicode code point at the specified index of this CharSequence.

Link copied to clipboard

Returns a stream of code point values from this sequence. Any surrogate pairs encountered in the sequence are combined as if by {@linkplain Character#toCodePoint Character.toCodePoint} and the result is passed to the stream. Any other code units, including ordinary BMP characters, unpaired surrogates, and undefined code units, are zero-extended to {@code int} values which are then passed to the stream.

Link copied to clipboard

Compares the two specified double values. The sign of the integer value returned is the same as that of the integer that would be returned by the call:

Compares the two specified float values. The sign of the integer value returned is the same as that of the integer that would be returned by the call:

Compares two Int values numerically.

Compares two long values numerically. The value returned is identical to what would be returned by:

Compares two short values numerically. The value returned is identical to what would be returned by:

Link copied to clipboard

Compares two byte values numerically treating the values as unsigned.

Compares two long values numerically treating the values as unsigned.

Link copied to clipboard
fun <K, V> MutableMap<K, V>.computeIfAbsent(key: K, mappingFunction: (K) -> V): V?

ported from java.util.Map.computeIfAbsent()

Link copied to clipboard
expect fun conditionAwaitBlocking(condition: Condition, time: Long, unit: TimeUnit): Boolean
Link copied to clipboard
expect fun conditionSignalAllBlocking(condition: Condition)
Link copied to clipboard
expect fun currentThreadId(): Long
Link copied to clipboard

Java‑style tail‑to‑head iterator for ArrayDeque.

Link copied to clipboard
Link copied to clipboard

Returns a representation of the specified double value according to the IEEE 754 "double format" bit layout.

Link copied to clipboard

Returns a representation of the specified double value according to the IEEE 754 "double format" bit layout, preserving the exact NaN bit-pattern.

Link copied to clipboard

Returns an integer representing the bits of the given value according to the IEEE 754 floating-point "single format" bit layout.

Link copied to clipboard

Returns an integer representing the raw bits of the given value according to the IEEE 754 floating-point "single format" bit layout.

Link copied to clipboard

mimics ``String(byte[] bytes, Charset charset)`` of jdk

fun String.Companion.fromByteArray(bytes: ByteArray, offset: Int, length: Int, charset: Charset): String

mimics public String(byte[] bytes, int offset, int length, Charset charset)

Link copied to clipboard

fun String.Companion.fromCharArray(value: CharArray, offset: Int, count: Int): String

trys to mimic following jdk code: however, in lucene context, COMPACT_STRINGS is always true, so gnore the check

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun StringBuilder.getChars(srcBegin: Int, srcEnd: Int, dst: CharArray, dstBegin: Int)

Copies characters from this StringBuilder into dst.

Link copied to clipboard
Link copied to clipboard
fun <E> ArrayDeque<E>.getFirst(): E
Link copied to clipboard
fun <E> ArrayDeque<E>.getLast(): E

Returns the last element of this deque.

Link copied to clipboard

Returns a hash code for a long value; compatible with Long.hashCode().

Link copied to clipboard

Returns an int value with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specified int value. Returns zero if the specified value has no one-bits in its two's complement binary representation, that is, if it is equal to zero.

Link copied to clipboard
fun inc(i: Int, modulus: Int): Int

Circularly increments i, mod modulus. Precondition and postcondition: 0 <= i < modulus.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns true if the argument is a finite floating-point value; returns false otherwise (for NaN and infinity arguments).

Returns true if the argument is a finite floating-point value; returns false otherwise (for NaN and infinity arguments).

Link copied to clipboard

Extension functions for surrogate detection.

Link copied to clipboard

Returns true if the specified number is infinitely large in magnitude, false otherwise.

Link copied to clipboard
Link copied to clipboard

Returns true if the specified number is a Not-a-Number (NaN) value, false otherwise.

Link copied to clipboard
fun Job.isVirtual(): Boolean
Link copied to clipboard
expect fun kmpSink(sink: BufferedSink): KmpSink
Link copied to clipboard
fun kmpWrite(sink: KmpSink?, buffer: Buffer?, b: ByteArray, off: Int, len: Int)

Platform-specific bulk write used by OkioSinkOutputStream.write.

Link copied to clipboard
Link copied to clipboard

Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified Int value. Returns 32 if the value is zero.

Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified long value. Returns 64 if the specified value has no one-bits in its two's complement representation, in other words if it is equal to zero.

Link copied to clipboard

Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified int value. Returns 32 if the specified value has no one-bits in its two's complement representation, in other words if it is equal to zero.

Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified long value. Returns 64 if the specified value has no one-bits in its two's complement representation, in other words if it is equal to zero.

Link copied to clipboard
fun <E> ArrayDeque<E>.peek(): E?
Link copied to clipboard
fun <E> ArrayDeque<E>.poll(): E?

Retrieves and removes the head of this queue, or returns {@code null} if this queue is empty.

Link copied to clipboard
fun <E> ArrayDeque<E>.pollFirst(): E?
Link copied to clipboard
fun <E> ArrayDeque<E>.pop(): E
Link copied to clipboard
Link copied to clipboard
fun <E> ArrayDeque<E>.push(e: E)
Link copied to clipboard
fun <K, V> MutableMap<K, V>.putIfAbsent(key: K, value: V): V?

ported from java.util.Map.putIfAbsent()

Link copied to clipboard
fun randomBigInteger(numBits: Int, rnd: Random): BigInteger

Port of Java BigInteger(int numBits, Random rnd): returns a non-negative random BigInteger in 0, 2^numBits - 1.

Link copied to clipboard
fun <K, V> MutableMap<K, V>.remove(key: K, value: V): Boolean

ported from java.util.Map.remove()

Link copied to clipboard
fun <K, V> MutableMap<K, V>.replace(key: K, value: V): V?

ported from java.util.Map.replace()

Link copied to clipboard

Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified int value.

Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified long value.

Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified short value.

Link copied to clipboard

Returns a comparator that imposes the reverse of the natural ordering.

Link copied to clipboard
fun Int.Companion.rotateLeft(i: Int, distance: Int): Int

Returns the value obtained by rotating the two's complement binary representation of the specified int value left by the specified number of bits. (Bits shifted out of the left hand, or high-order, side reenter on the right, or low-order.)

fun Long.Companion.rotateLeft(i: Long, distance: Int): Long

Returns the value obtained by rotating the two's complement binary representation of the specified long value left by the specified number of bits. (Bits shifted out of the left hand, or high-order, side reenter on the right, or low-order.)

Link copied to clipboard
fun Long.Companion.rotateRight(i: Long, distance: Int): Long

Returns the value obtained by rotating the two's complement binary representation of the specified long value right by the specified number of bits. (Bits shifted out of the right hand, or low-order, side reenter on the left, or high-order.)

Link copied to clipboard
fun AtomicInt.set(value: Int)
Link copied to clipboard
fun Buffer.setByteAt(position: Long, value: Byte)

Extension function for Buffer to set a byte at an absolute position.

Link copied to clipboard
fun StringBuilder.setCharAt(index: Int, ch: Char)
Link copied to clipboard

Returns the signum function of the specified int value. (The return value is -1 if the specified value is negative; 0 if the specified value is zero; and 1 if the specified value is positive.)

Link copied to clipboard
inline fun <E> MutableList<E>.sort(Comparator: Comparator<E>)
Link copied to clipboard
expect fun stringBuilderGetChars(src: StringBuilder, srcBegin: Int, srcEnd: Int, dst: CharArray, dstBegin: Int)
Link copied to clipboard

Returns a string representation of the unsigned integer value of i in binary (base 2).

Returns a string representation of the long argument as an unsigned integer in base 2.

Link copied to clipboard

mimics ``byte[] String.getBytes(Charset charset)`` of jdk

Link copied to clipboard
fun toCodePoint(high: Char, low: Char): Int

Converts a surrogate pair into the corresponding Unicode code point.

Link copied to clipboard
Link copied to clipboard

Returns a string representation of the long argument as an unsigned integer in base 16.

Link copied to clipboard
fun Path.toRealPath(): Path
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Converts the argument to an int by an unsigned conversion. In an unsigned conversion to an int, the high-order 24 bits of the int are zero and the low-order 8 bits are equal to the bits of the byte argument.

Converts the argument to an int by an unsigned conversion. In an unsigned conversion to an int, the high-order 16 bits of the int are zero and the low-order 16 bits are equal to the bits of the short argument.

Link copied to clipboard

Converts the argument to a long by an unsigned conversion. In an unsigned conversion to a long, the high-order 56 bits of the long are zero and the low-order 8 bits are equal to the bits of the byte argument.

Converts the argument to a long by an unsigned conversion. In an unsigned conversion to a long, the high-order 32 bits of the long are zero and the low-order 32 bits are equal to the bits of the integer argument.

Converts the argument to a long by an unsigned conversion. In an unsigned conversion to a long, the high-order 48 bits of the long are zero and the low-order 16 bits are equal to the bits of the short argument.

Link copied to clipboard

Returns a string representation of the long argument as an unsigned integer in base 10.

Link copied to clipboard

Format a long (treated as unsigned) into a String.

Link copied to clipboard
fun AtomicLong.updateAndGet(updateFunction: (Long) -> Long): Long

Atomically updates (with memory effects as specified by {@link VarHandle#compareAndSet}) the current value with the results of applying the given function, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.

Link copied to clipboard
fun BigInteger.Companion.valueOf(value: Long): BigInteger

Returns a BigInteger whose value is equal to that of the specified long.

Link copied to clipboard
fun AtomicInt.weakCompareAndSetVolatile(expectedValue: Int, newValue: Int): Boolean

Possibly atomically sets the value to newValue if the current value == expectedValue.

Link copied to clipboard
inline fun <T> ReentrantLock.withLock(action: () -> T): T