diff --git a/dataforge-context/src/commonMain/kotlin/hep/dataforge/provider/Path.kt b/dataforge-context/src/commonMain/kotlin/hep/dataforge/provider/Path.kt index 77f05771..149a9ece 100644 --- a/dataforge-context/src/commonMain/kotlin/hep/dataforge/provider/Path.kt +++ b/dataforge-context/src/commonMain/kotlin/hep/dataforge/provider/Path.kt @@ -19,28 +19,15 @@ import hep.dataforge.names.Name import hep.dataforge.names.toName /** - * - * * Path interface. * - * @author Alexander Nozik - * @version $Id: $Id */ public inline class Path(public val tokens: List) : Iterable { - public val head: PathToken? get() = tokens.firstOrNull() - - public val length: Int get() = tokens.size - - /** - * Returns non-empty optional containing the chain without first segment in case of chain path. - * - * @return - */ - public val tail: Path? get() = if (tokens.isEmpty()) null else Path(tokens.drop(1)) - override fun iterator(): Iterator = tokens.iterator() + override fun toString(): String = tokens.joinToString(separator = PATH_SEGMENT_SEPARATOR) + public companion object { public const val PATH_SEGMENT_SEPARATOR: String = "/" @@ -52,6 +39,19 @@ public inline class Path(public val tokens: List) : Iterable