org.allenai.nlpstack.parse.poly.core

Position

Related Docs: object Position | package core

case class Position(components: Seq[Int]) extends Product with Serializable

A Position is a essentially a pointer to a node in a rooted, directed tree. It is a sequence of non-negative integers.

It is probably easiest to describe the concept by example. The root of the tree is the empty sequence. The first child of the root is Seq(0) (we count from zero). The third child of the first child of the root is Seq(2, 0). The seventh child of the third child of the first child of the root is Seq(6, 2, 0). Etc.

components

the sequence of integers corresponding to a node's position in a tree

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Position
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Position(components: Seq[Int])

    components

    the sequence of integers corresponding to a node's position in a tree

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. val components: Seq[Int]

    the sequence of integers corresponding to a node's position in a tree

  7. lazy val depth: Int

    The depth of the position in the tree.

    The depth of the position in the tree.

    i.e. the depth of the root is zero, the depth of the root's children is one, etc.

  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def getChild(childIndex: Int): Position

    Gets the kth child of this position.

    Gets the kth child of this position.

    childIndex

    the number of the desired child (counting from zero)

    returns

    the child's position

  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def isDescendentOf(position: Position): Boolean

    Returns whether the specified position is a descendant of this position.

    Returns whether the specified position is a descendant of this position.

    This returns true if the argument position is the same as this position (i.e. a position is considered by this function to be its own descendant).

    position

    the position of interest

    returns

    whether the specified position is a descendant of this position

  13. final def isInstanceOf[T0]: Boolean

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

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. lazy val parent: Option[Position]

    Gets the parent of this position (if it exists).

    Gets the parent of this position (if it exists).

    This returns None if this is the root position.

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

    Definition Classes
    AnyRef
  19. def toString(): String

    Definition Classes
    Position → AnyRef → Any
  20. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped