LazyReader

halotukozak.alpaca.internal.lexer.LazyReader
See theLazyReader companion object
final class LazyReader extends CharSequence, Closeable

A lazy character sequence that reads from a Reader on demand.

This class is useful for tokenizing large files without loading them entirely into memory. It buffers characters as they are accessed and can efficiently skip over processed characters.

Like the Reader it wraps, it is consumed as it is read. Create it with LazyReader.from.

Attributes

Companion
object
Source
LazyReader.scala
Graph
Supertypes
trait Closeable
trait AutoCloseable
trait CharSequence
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def charAt(pos: Int): Char

Gets the character at the specified position.

Gets the character at the specified position.

This will read from the underlying Reader if necessary.

Value parameters

pos

the position (0-based)

Attributes

Returns

the character at that position

Throws
IndexOutOfBoundsException

if the position is beyond the end of input

Source
LazyReader.scala
override def close(): Unit

Attributes

Definition Classes
Closeable -> AutoCloseable
Source
LazyReader.scala
def length: Int

Gets the length of the input.

Gets the length of the input.

Attributes

Returns

the length, capped at Int.MaxValue

Source
LazyReader.scala
def subSequence(start: Int, end: Int): CharSequence

Creates a subsequence.

Creates a subsequence.

Value parameters

end

the end position (exclusive)

start

the start position (inclusive)

Attributes

Returns

a string containing the subsequence

Source
LazyReader.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
CharSequence -> Any
Source
LazyReader.scala

Inherited methods

def chars(): IntStream

Attributes

Inherited from:
CharSequence
def codePoints(): IntStream

Attributes

Inherited from:
CharSequence
def isEmpty(): Boolean

Attributes

Inherited from:
CharSequence