telepath / com.github.giedomak.telepath.datamodels.stores / PathIdentifierStore

PathIdentifierStore

object PathIdentifierStore (source)

Singleton class which stores the mapping from a list of edges to IDs.

Let's say we have 3 edges along a path with edge IDs 6, 3 and 33. We serialize these edge IDs into the String "6,3,33". This serialized String will be the key in our pathEdgeSerializationStore HashMap. And it will be the value in our pathIdentifierStore HashMap. We map this String to a generated ID.

Functions

clear

fun clear(): Unit

concatenatePaths

fun concatenatePaths(path1: Path, path2: Path): Path?

Concatenate two given paths.

getEdgeSet

fun getEdgeSet(pathIdentifier: Long): List<Edge>

Return a list of Edges for a given path identifier.

getPathIdByEdgeLabel

fun getPathIdByEdgeLabel(edgeLabel: String): Long

Get or generate a pathId when given a single edge label.

fun getPathIdByEdgeLabel(edgeLabels: List<String>): Long

Get or generate a pathId for a given list of edge labels.

getPathIdByEdges

fun getPathIdByEdges(edges: List<Edge>): Long

Get the Path identifier which belongs to a certain edge set.

getPathIds

fun getPathIds(k: Int): List<Long>

Get all path identifiers which have size k.