dotty.tools.dotc.util
Type members
Classlikes
A class inheriting from Attachment.Container supports adding, removing and lookup of attachments. Attachments are typed key/value pairs.
A class inheriting from Attachment.Container supports adding, removing and lookup of attachments. Attachments are typed key/value pairs.
Attachments whose key is an instance of StickyKey
will be kept when the attachments
are copied using withAttachmentsFrom
.
A character buffer that exposes the internal array for reading. That way we can avoid copying when converting to names.
A character buffer that exposes the internal array for reading. That way we can avoid copying when converting to names.
Contains constants and classifier methods for characters
Contains constants and classifier methods for characters
The comment parsing in dotc
is used by both the comment cooking and the
dottydoc tool.
The comment parsing in dotc
is used by both the comment cooking and the
dottydoc tool.
The comment cooking is used to expand comments with <invalid inheritdoc annotation>
and
@define
annotations. The rest of the comment is untouched and later
handled by dottydoc.
Adds standard functionality to a class.
For now: Just the unsupported
method.
Adds standard functionality to a class.
For now: Just the unsupported
method.
A specialized implementation of GenericHashMap with identity hash and eq
as comparison.
A specialized implementation of GenericHashMap with identity hash and eq
as comparison.
A hash table using open hashing with linear scan which is also very space efficient
at small sizes. The implementations of hash
and isEqual
are left open. They have
to be provided by subclasses.
A hash table using open hashing with linear scan which is also very space efficient
at small sizes. The implementations of hash
and isEqual
are left open. They have
to be provided by subclasses.
- Value Params
- capacityMultiple
The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.
- initialCapacity
Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given
initialCapacity
. Minimum value is 4.
- Companion
- object
A specialized implementation of GenericHashMap with standard hashCode and equals as comparison
A specialized implementation of GenericHashMap with standard hashCode and equals as comparison
A hash set that allows some privileged protected access to its internals
A hash set that allows some privileged protected access to its internals
- Value Params
- capacityMultiple
The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.
- initialCapacity
Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given
initialCapacity
. Minimum value is 4.
- Companion
- object
A dense map from some Key
type to Int. Dense means: All keys and values are stored in arrays from 0 up to the size of the map. Keys and values can be obtained by index using
key(index)and
value(index). Values can also be stored using
setValue(index, value)`.
A dense map from some Key
type to Int. Dense means: All keys and values are stored in arrays from 0 up to the size of the map. Keys and values can be obtained by index using
key(index)and
value(index). Values can also be stored using
setValue(index, value)`.
ome privileged protected access to its internals
- Value Params
- capacityMultiple
The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.
- initialCapacity
Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given
initialCapacity
. Minimum value is 4.
A least-recently-used cache for Key -> Value computations
It currently keeps the last 8 associations, but this can be
changed to anywhere between 2 and 16 by changing LRUCache.Retained
.
A least-recently-used cache for Key -> Value computations
It currently keeps the last 8 associations, but this can be
changed to anywhere between 2 and 16 by changing LRUCache.Retained
.
Implementation: We keep a ring of eight places, linked
with the next
data structure. The ring models a priority queue.
last
points to the last element of the queue, and
next(last)
to the first one. Lookups compare keys
sequentially from first to last. Elements with successful lookup
get promoted to be first in the queue. Elements are evicted
at the last
position.
- Companion
- object
Provides functions to encode and decode Scala symbolic names.
Provides functions to encode and decode Scala symbolic names.
A parsed doc comment.
A parsed doc comment.
- Value Params
- comment
The doc comment to parse
- Companion
- object
A map that maps keys to unique integers in a dense interval starting at 0.
A map that maps keys to unique integers in a dense interval starting at 0.
- Value Params
- capacityMultiple
The minimum multiple of capacity relative to used elements. The hash table will be re-sized once the number of elements multiplied by capacityMultiple exceeds the current size of the hash table. However, a table of size up to DenseLimit will be re-sized only once the number of elements reaches the table's size.
- initialCapacity
Indicates the initial number of slots in the hash table. The actual number of slots is always a power of 2, so the initial size of the table will be the smallest power of two that is equal or greater than the given
initialCapacity
. Minimum value is 4.
- Companion
- object
Defines a key type with which to tag properties, such as attachments or context properties
Defines a key type with which to tag properties, such as attachments or context properties
A class for the reading part of mutable or immutable maps.
A class for the reading part of mutable or immutable maps.
A class for the readonly part of mutable sets.
A class for the readonly part of mutable sets.
- Companion
- object
A wrapper for a list of cached instances of a type T
.
The wrapper is recursion-reentrant: several instances are kept, so
at each depth of reentrance we are reusing the instance for that.
A wrapper for a list of cached instances of a type T
.
The wrapper is recursion-reentrant: several instances are kept, so
at each depth of reentrance we are reusing the instance for that.
An instance is created upon creating this object, and more instances are allocated dynamically, on demand, when reentrance occurs.
Not thread safe.
Ported from scala.reflect.internal.util.ReusableInstance
- Companion
- object
A simple linked map with eq
as the key comparison, optimized for small maps.
It has linear complexity for apply
, updated
, and remove
.
A simple linked map with eq
as the key comparison, optimized for small maps.
It has linear complexity for apply
, updated
, and remove
.
- Companion
- object
A simple linked set with eq
as the comparison, optimized for small sets.
It has linear complexity for contains
, +
, and -
.
A simple linked set with eq
as the comparison, optimized for small sets.
It has linear complexity for contains
, +
, and -
.
- Companion
- object
An efficient implementation of sequences of 16 indexed elements with values 0..15 in a single Long.
An efficient implementation of sequences of 16 indexed elements with values 0..15 in a single Long.
- Companion
- object
A source position is comprised of a span and a source file
A source position is comprised of a span and a source file
The offsets part of a full position, consisting of 2 or 3 entries:
The offsets part of a full position, consisting of 2 or 3 entries:
- start: the start offset of the span, in characters from start of file
- end : the end offset of the span
- point: if given, the offset where a single
^
would be logically placed
Spans are encoded according to the following format in little endian: Start: unsigned 26 Bits (works for source files up to 64M) End: unsigned 26 Bits Point: unsigned 12 Bits relative to start NoSpan encoded as -1L (this is a normally invalid span because point would lie beyond end).
Things that can produce a source position and a span
Things that can produce a source position and a span
A HashSet where the elements are stored weakly. Elements in this set are eligible for GC if no other hard references are associated with them. Its primary use case is as a canonical reference identity holder (aka "hash-consing") via findEntryOrUpdate
A HashSet where the elements are stored weakly. Elements in this set are eligible for GC if no other hard references are associated with them. Its primary use case is as a canonical reference identity holder (aka "hash-consing") via findEntryOrUpdate
This Set implementation cannot hold null. Any attempt to put a null in it will result in a NullPointerException
This set implementation is not in general thread safe without external concurrency control. However it behaves properly when GC concurrently collects elements in this set.
- Companion
- object
Types
A linear map is a map where after an updated
the previous map
value cannot be used anymore. The map is implemented as an immutable
map for sizes <= 4 (where immutable maps have specialized, compact
representations) and as a HashMap for larger sizes.
A linear map is a map where after an updated
the previous map
value cannot be used anymore. The map is implemented as an immutable
map for sizes <= 4 (where immutable maps have specialized, compact
representations) and as a HashMap for larger sizes.
A linear set is a set where after a +
the previous set value cannot be
used anymore. The set is implemented as an immutable set for sizes <= 4
and as a HashSet for larger sizes.
A linear set is a set where after a +
the previous set value cannot be
used anymore. The set is implemented as an immutable set for sizes <= 4
and as a HashSet for larger sizes.