telepath / com.github.giedomak.telepath.kpathindex / KPathIndex

KPathIndex

interface KPathIndex (source)

KPathIndex interface defining the public methods of a path index.

Properties

insertCallback

abstract var insertCallback: (Path) -> Unit

Callback which will be called after insertion of a path into the index.

k

abstract var k: Int

K indicates the paths with up to this K number of edges are indexed in the kPathIndex. For example: if K=2, the index contains all paths which have 1 or 2 edges along the path.

Functions

insert

abstract fun insert(path: Path, dryRun: Boolean = false): Unit

Insert method to insert a Path into the KPathIndex.

search

abstract fun search(pathPrefix: PathPrefix): Stream<Path>

Search method to lookup paths in the KPathIndex.

Inheritors

KPathIndexDisk

class KPathIndexDisk : KPathIndex

KPathIndexInMemory

class KPathIndexInMemory : KPathIndex

InMemory implementation of the KPathIndex.