de.sciss.contextsnake

ContextTree

trait ContextTree[A] extends Like[A]

A mutable data append-only suffix tree that support efficient searching for sub-sequences.

A

the element type of the structure

Linear Supertypes
Like[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ContextTree
  2. Like
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def +=(elem: A): ContextTree.this.type

    Appends an element to the tree.

    Appends an element to the tree.

    elem

    the element to append

    returns

    this same tree

    Definition Classes
    ContextTreeLike
  2. abstract def append(elems: A*): Unit

    Appends multiple elements to the tree

    Appends multiple elements to the tree

    elems

    the elements to append

    Definition Classes
    ContextTreeLike
  3. abstract def appendAll(xs: TraversableOnce[A]): Unit

    Appends all elements of a collection to the tree.

    Appends all elements of a collection to the tree. The elements are appended in the order in which they are contained in the argument.

    xs

    the collection whose elements should be appended

    Definition Classes
    ContextTreeLike
  4. abstract def apply(idx: Int): A

    Queries an element at a given index.

    Queries an element at a given index. Throws an exception if the idx argument is negative or greater than or equal to the size of the tree.

    idx

    the index of the element

    returns

    the element at the given index

    Definition Classes
    ContextTreeLike
  5. abstract def contains(elem: A): Boolean

    Tests whether an element is contained in the tree.

    Tests whether an element is contained in the tree. This is a constant time operation.

    elem

    the element to look for

    returns

    true if the element is included in the tree, false otherwise

  6. abstract def containsSlice(xs: TraversableOnce[A]): Boolean

    Tests whether a given sub-sequence is contained in the tree.

    Tests whether a given sub-sequence is contained in the tree. This is a very fast operation taking O(|xs|).

    xs

    the sequence to look for

    returns

    true if the sequence is included in the tree, false otherwise

  7. abstract def isEmpty: Boolean

    Queries whether the collection is empty (has zero elements)

    Queries whether the collection is empty (has zero elements)

    Definition Classes
    ContextTreeLike
  8. abstract def length: Int

    The length of the collection in this tree.

    The length of the collection in this tree. Same as size

    Definition Classes
    ContextTreeLike
  9. abstract def nonEmpty: Boolean

    Queries whether the collection non-empty (has one or more elements)

    Queries whether the collection non-empty (has one or more elements)

    Definition Classes
    ContextTreeLike
  10. abstract def size: Int

    Queries the number of elements in the tree

    Queries the number of elements in the tree

    Definition Classes
    ContextTreeLike
  11. abstract def snake(init: TraversableOnce[A]): Snake[A]

    Creates a new snake through the tree from a given initial sequence.

    Creates a new snake through the tree from a given initial sequence. This initial sequence must be contained in the tree (e.g. containsSlice must return true), otherwise an exception is thrown.

    To construct a snake from a particular index range of the tree, use snake(view(from, until)). Note that because the sequence might occur multiple times in the corpus, this does not guarantee any particular resulting index into the tree.

    init

    the sequence to begin with

    returns

    a new snake whose content is init

  12. abstract def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A]]): Col[A]

    Converts this tree into another collection by copying all elements.

    Converts this tree into another collection by copying all elements.

    Col

    the target collection type

    cbf

    the builder factory which determines the target collection type

    returns

    a new independent collection containing all elements of this tree

    Definition Classes
    ContextTreeLike
  13. abstract def toDOT(tailEdges: Boolean = false, sep: String = ""): String

    Helper method to export the tree to GraphViz DOT format.

    Helper method to export the tree to GraphViz DOT format. This is mostly for debugging or demonstration purposes and might not be particularly efficient or suitable for large trees.

    tailEdges

    whether to include the tail (suffix-pointer) edges or not

    returns

    a string representation in DOT format

  14. abstract def view(from: Int, until: Int): SeqView[A, Buffer[A]]

    Provides a view of a range of the underlying buffer.

    Provides a view of a range of the underlying buffer. Technically, because the underlying buffer is mutable, this view would be subject to mutations as well until a copy is built. However, since the tree is append-only, the portion visible in the view will never change.

    Note that, like the view method in collection.mutable.Buffer, the range is clipped to the length of the underlying buffer _at this moment_. For example, if the buffer currently has 6 elements, a view(7,8) is treated as view(6,6) and will always be empty. Therefore it is save to treat the view as immutable.

    from

    the start index into the collection

    until

    the stop index (exclusive) into the collection

    returns

    a view of the given range.

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  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. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  18. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Like[A]

Inherited from AnyRef

Inherited from Any

Ungrouped