Class/Object

eu.cdevreeze.yaidom.queryapi

ElemWithPath

Related Docs: object ElemWithPath | package queryapi

Permalink

final class ElemWithPath[E <: IsNavigableApi[E]] extends ElemLike[ElemWithPath[E]]

Pair of an element and a Path. These pairs themselves offer the ElemApi query API, so they can be seen as "element implementations" themselves. They are like very light-weight "indexed" elements.

These "elements" are used in the implementation of bulk update methods in trait UpdatableElemLike, but they can also be used in application code.

Note that this class renders a separate query API for element-path pairs obsolete. It takes a IsNavigableApi, using its findAllChildElemsWithPathEntries method, and offers the equivalent of an ElemApi for element-path pairs.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ElemWithPath
  2. ElemLike
  3. ElemApi
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ElemWithPath(elem: E, path: Path)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def \(p: (ElemWithPath[E]) ⇒ Boolean): IndexedSeq[ElemWithPath[E]]

    Permalink

    Shorthand for filterChildElems(p).

    Shorthand for filterChildElems(p). Use this shorthand only if the predicate is a short expression.

    Definition Classes
    ElemLikeElemApi
  5. final def \\(p: (ElemWithPath[E]) ⇒ Boolean): IndexedSeq[ElemWithPath[E]]

    Permalink

    Shorthand for filterElemsOrSelf(p).

    Shorthand for filterElemsOrSelf(p). Use this shorthand only if the predicate is a short expression.

    Definition Classes
    ElemLikeElemApi
  6. final def \\!(p: (ElemWithPath[E]) ⇒ Boolean): IndexedSeq[ElemWithPath[E]]

    Permalink

    Shorthand for findTopmostElemsOrSelf(p).

    Shorthand for findTopmostElemsOrSelf(p). Use this shorthand only if the predicate is a short expression.

    Definition Classes
    ElemLikeElemApi
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. val elem: E

    Permalink
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def filterChildElems(p: (ElemWithPath[E]) ⇒ Boolean): IndexedSeq[ElemWithPath[E]]

    Permalink

    Returns the child elements obeying the given predicate.

    Returns the child elements obeying the given predicate. This method could be defined as:

    def filterChildElems(p: E => Boolean): immutable.IndexedSeq[E] =
      this.findAllChildElems.filter(p)
    Definition Classes
    ElemLikeElemApi
  13. final def filterElems(p: (ElemWithPath[E]) ⇒ Boolean): IndexedSeq[ElemWithPath[E]]

    Permalink

    Returns the descendant elements obeying the given predicate.

    Returns the descendant elements obeying the given predicate. This method could be defined as:

    this.findAllChildElems flatMap (_.filterElemsOrSelf(p))
    Definition Classes
    ElemLikeElemApi
  14. final def filterElemsOrSelf(p: (ElemWithPath[E]) ⇒ Boolean): IndexedSeq[ElemWithPath[E]]

    Permalink

    Returns the descendant-or-self elements obeying the given predicate.

    Returns the descendant-or-self elements obeying the given predicate. This method could be defined as:

    def filterElemsOrSelf(p: E => Boolean): immutable.IndexedSeq[E] =
      Vector(this).filter(p) ++ (this.findAllChildElems flatMap (_.filterElemsOrSelf(p)))

    It can be proven that the result is equivalent to findAllElemsOrSelf filter p.

    Definition Classes
    ElemLikeElemApi
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def findAllChildElems: IndexedSeq[ElemWithPath[E]]

    Permalink

    Core method that returns all child elements, in the correct order.

    Core method that returns all child elements, in the correct order. Other operations can be defined in terms of this one.

    Definition Classes
    ElemWithPathElemLikeElemApi
  17. final def findAllElems: IndexedSeq[ElemWithPath[E]]

    Permalink

    Returns all descendant elements (not including this element).

    Returns all descendant elements (not including this element). This method could be defined as filterElems { e => true }. Equivalent to findAllElemsOrSelf.drop(1).

    Definition Classes
    ElemLikeElemApi
  18. final def findAllElemsOrSelf: IndexedSeq[ElemWithPath[E]]

    Permalink

    Returns this element followed by all descendant elements (that is, the descendant-or-self elements).

    Returns this element followed by all descendant elements (that is, the descendant-or-self elements). This method could be defined as filterElemsOrSelf { e => true }.

    Definition Classes
    ElemLikeElemApi
  19. final def findChildElem(p: (ElemWithPath[E]) ⇒ Boolean): Option[ElemWithPath[E]]

    Permalink

    Returns the first found child element obeying the given predicate, if any, wrapped in an Option.

    Returns the first found child element obeying the given predicate, if any, wrapped in an Option. This method could be defined as filterChildElems(p).headOption.

    Definition Classes
    ElemLikeElemApi
  20. final def findElem(p: (ElemWithPath[E]) ⇒ Boolean): Option[ElemWithPath[E]]

    Permalink

    Returns the first found (topmost) descendant element obeying the given predicate, if any, wrapped in an Option.

    Returns the first found (topmost) descendant element obeying the given predicate, if any, wrapped in an Option. This method could be defined as filterElems(p).headOption.

    Definition Classes
    ElemLikeElemApi
  21. final def findElemOrSelf(p: (ElemWithPath[E]) ⇒ Boolean): Option[ElemWithPath[E]]

    Permalink

    Returns the first found (topmost) descendant-or-self element obeying the given predicate, if any, wrapped in an Option.

    Returns the first found (topmost) descendant-or-self element obeying the given predicate, if any, wrapped in an Option. This method could be defined as filterElemsOrSelf(p).headOption.

    Definition Classes
    ElemLikeElemApi
  22. final def findTopmostElems(p: (ElemWithPath[E]) ⇒ Boolean): IndexedSeq[ElemWithPath[E]]

    Permalink

    Returns the descendant elements obeying the given predicate that have no ancestor obeying the predicate.

    Returns the descendant elements obeying the given predicate that have no ancestor obeying the predicate. This method could be defined as:

    this.findAllChildElems flatMap (_.findTopmostElemsOrSelf(p))
    Definition Classes
    ElemLikeElemApi
  23. final def findTopmostElemsOrSelf(p: (ElemWithPath[E]) ⇒ Boolean): IndexedSeq[ElemWithPath[E]]

    Permalink

    Returns the descendant-or-self elements obeying the given predicate, such that no ancestor obeys the predicate.

    Returns the descendant-or-self elements obeying the given predicate, such that no ancestor obeys the predicate. This method could be defined as:

    def findTopmostElemsOrSelf(p: E => Boolean): immutable.IndexedSeq[E] =
      if (p(this)) Vector(this)
      else (this.findAllChildElems flatMap (_.findTopmostElemsOrSelf(p)))
    Definition Classes
    ElemLikeElemApi
  24. final def getChildElem(p: (ElemWithPath[E]) ⇒ Boolean): ElemWithPath[E]

    Permalink

    Returns the single child element obeying the given predicate, and throws an exception otherwise.

    Returns the single child element obeying the given predicate, and throws an exception otherwise. This method could be defined as findChildElem(p).get.

    Definition Classes
    ElemLikeElemApi
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. val path: Path

    Permalink
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  33. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  34. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ElemLike[ElemWithPath[E]]

Inherited from ElemApi[ElemWithPath[E]]

Inherited from AnyRef

Inherited from Any

Ungrouped