trait IsNavigable extends IsNavigableApi
API and implementation trait for elements that can be navigated using paths.
More precisely, this trait has only the following abstract methods: findChildElemByPathEntry
and findAllChildElemsWithPathEntries
.
The purely abstract API offered by this trait is eu.cdevreeze.yaidom.queryapi.IsNavigableApi. See the documentation of that trait for more information.
All methods are overridable. Hence element implementations mixing in this partial implementation trait can change the implementation without breaking its API, caused by otherwise needed removal of this mixin. Arguably this trait should not exist as part of the public API, because implementation details should not be part of the public API. Such implementation details may be subtle, such as the (runtime) boundary on the ThisElem type member.
- Alphabetic
- By Inheritance
- IsNavigable
- IsNavigableApi
- AnyElemApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
abstract
type
ThisElem <: Aux[ThisElem]
The element type itself.
The element type itself. It must be restricted to a sub-type of the query API trait in question.
Concrete element classes will restrict this type to that element class itself.
- Definition Classes
- IsNavigable → IsNavigableApi → AnyElemApi
Abstract Value Members
-
abstract
def
findAllChildElemsWithPathEntries: IndexedSeq[(ThisElem, Entry)]
Returns all child elements paired with their path entries.
Returns all child elements paired with their path entries.
- Definition Classes
- IsNavigable → IsNavigableApi
-
abstract
def
findChildElemByPathEntry(entry: Entry): Option[ThisElem]
Finds the child element with the given
Path.Entry
(where this element is the root), if any, wrapped in anOption
.Finds the child element with the given
Path.Entry
(where this element is the root), if any, wrapped in anOption
.Typically this method must be very efficient, in order for methods like findElemOrSelfByPath to be efficient.
- Definition Classes
- IsNavigable → IsNavigableApi
-
abstract
def
thisElem: ThisElem
This element itself.
This element itself.
- Definition Classes
- AnyElemApi
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
findElemOrSelfByPath(path: Path): Option[ThisElem]
Finds the element with the given
Path
(where this element is the root), if any, wrapped in anOption
.Finds the element with the given
Path
(where this element is the root), if any, wrapped in anOption
.That is, returns:
findReverseAncestryOrSelfByPath(path).map(_.last)
Note that for each non-empty Path, we have:
findElemOrSelfByPath(path) == findChildElemByPathEntry(path.firstEntry). flatMap(_.findElemOrSelfByPath(path.withoutFirstEntry))
- Definition Classes
- IsNavigable → IsNavigableApi
-
def
findReverseAncestryOrSelfByPath(path: Path): Option[IndexedSeq[ThisElem]]
Finds the reversed ancestry-or-self of the element with the given
Path
(where this element is the root), wrapped in an Option.Finds the reversed ancestry-or-self of the element with the given
Path
(where this element is the root), wrapped in an Option. None is returned if no element can be found at the given Path.Hence, the resulting element collection, if any, starts with this element and ends with the element at the given Path, relative to this element.
This method comes in handy for (efficiently) computing base URIs, where the (reverse) ancestry-or-self is needed as input.
- Definition Classes
- IsNavigable → IsNavigableApi
-
def
getChildElemByPathEntry(entry: Entry): ThisElem
Returns (the equivalent of)
findChildElemByPathEntry(entry).get
Returns (the equivalent of)
findChildElemByPathEntry(entry).get
- Definition Classes
- IsNavigable → IsNavigableApi
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getElemOrSelfByPath(path: Path): ThisElem
Returns (the equivalent of)
findElemOrSelfByPath(path).get
Returns (the equivalent of)
findElemOrSelfByPath(path).get
- Definition Classes
- IsNavigable → IsNavigableApi
-
def
getReverseAncestryOrSelfByPath(path: Path): IndexedSeq[ThisElem]
Returns (the equivalent of)
findReverseAncestryOrSelfByPath(path).get
Returns (the equivalent of)
findReverseAncestryOrSelfByPath(path).get
- Definition Classes
- IsNavigable → IsNavigableApi
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()