MutablePathMultimap

Mutable multimap implementation mapping paths to values of type T. Extends PathMultimap with operations to mutate the multimap.

Inheritors

Properties

Link copied to clipboard

Sequence of all entries in the multimap (may have repeated entries).

Link copied to clipboard
abstract val size: Int

Number of entries in the multimap.

Link copied to clipboard
open val values: Sequence<T>

Sequence of values in the multimap (may have repeated values).

Functions

Link copied to clipboard
abstract fun clear()

Removes all entries from the path multimap.

Link copied to clipboard
open operator fun contains(value: T): Boolean

Returns whether there exists at least one value equal to value in the multimap. Equivalent to containsValue(value).

open operator fun contains(entryId: PathMultimapEntryId): Boolean

Returns whether there exists an entry identified by entryId in the multimap. Equivalent to containsEntry(entryId).

open operator fun contains(path: String): Boolean
open operator fun contains(path: Path): Boolean

Returns whether there exists at least one entry with a path matching path (following the semantics of path matching). Equivalent to containsPath(path).

Link copied to clipboard
abstract fun containsEntry(entryId: PathMultimapEntryId): Boolean

Returns whether there exists an entry identified by entryId in the multimap.

Link copied to clipboard
open fun containsPath(path: String): Boolean
abstract fun containsPath(path: Path): Boolean

Returns whether there exists at least one entry with a path matching path (following the semantics of path matching).

Link copied to clipboard
abstract fun containsValue(value: T): Boolean

Returns whether there exists at least one value equal to value in the multimap.

Link copied to clipboard
abstract fun entries(path: Path = AbsolutePath.MATCH_ALL): Sequence<PathMultimapEntry<T>>

Returns a sequence over all entries with a path matching path (following the semantics of path matching).

Link copied to clipboard
open operator fun get(entryId: PathMultimapEntryId): PathMultimapEntry<T>?

Returns the entry identified by entryId or null when no such entry exists. Equivalent to getEntry(entryId).

open operator fun get(path: String): Sequence<T>
abstract operator fun get(path: Path): Sequence<T>

Returns a sequence over all values with a path matching path (following the semantics of path matching).

Link copied to clipboard

Returns the entry identified by entryId or null when no such entry exists.

Link copied to clipboard
open fun getOne(path: String): T?
open fun getOne(path: Path): T?

Returns one value matching path or null when no such value exists. Equivalent to get(path).firstOrNull().

Link copied to clipboard
open fun isEmpty(): Boolean

Whether the multimap is empty.

Link copied to clipboard
open fun put(path: String, value: T): PathMultimapEntryId
abstract fun put(path: Path, value: T): PathMultimapEntryId

Inserts a new entry in the multimap with the given path and value and returns an identifier that identifies the inserted entry in the multimap.

Link copied to clipboard
open fun putAll(pathMultimap: PathMultimap<T>): List<PathMultimapEntryId>

Inserts all entries of pathMultimap into this multimap and returns a list with the identifiers of each inserted entry.

Link copied to clipboard
open fun remove(path: String): List<PathMultimapEntry<T>>
abstract fun remove(path: Path): List<PathMultimapEntry<T>>

Removes all entries with a path contained by path (following the semantics of path containment) and returns a list of said entries.

Link copied to clipboard

Removes the entry identified by entryId and returns it or null when no such entry exists.

Link copied to clipboard
operator fun <T> MutablePathMultimap<T>.set(path: String, value: T): PathMultimapEntryId
operator fun <T> MutablePathMultimap<T>.set(path: Path, value: T): PathMultimapEntryId

Inserts a new entry in the multimap with the given path and value and returns an identifier that identifies the inserted entry in the multimap.

Link copied to clipboard

Transforms the multimap into a mapping of paths to lists of values associated with them.