ws.kahn.ot

Delta

case class Delta(operations: IndexedSeq[Operation]) extends Product with Serializable

A delta represents a change performed on a document as a sequence of operations that move a cursor over the document.

operations

the list of operations in order. An operation can be any one of:

  • retain: advance the current position, skipping over characters
  • insert: insert characters at the current position
  • delete: delete characters at the current position
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Delta
  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 Delta(operations: IndexedSeq[Operation])

    operations

    the list of operations in order. An operation can be any one of:

    • retain: advance the current position, skipping over characters
    • insert: insert characters at the current position
    • delete: delete characters at the current position

Value Members

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

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

    Definition Classes
    AnyRef → Any
  3. def +:(operation: Operation): Delta

    Prepend an operation to this delta.

    Prepend an operation to this delta.

    operation
    returns

    the delta with the operation prepended

  4. def :+(operation: Operation): Delta

    Append an operation ot this delta.

    Append an operation ot this delta.

    operation
    returns

    the delta with the operation appended

  5. final def ==(arg0: Any): Boolean

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

    Definition Classes
    Any
  7. val baseLength: Int

    The length of the starting document this delta operates on.

    The length of the starting document this delta operates on. Equal to the sum of the lengths of its retain and delete operations.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def compose(that: Delta): Delta

    Composes two deltas together, that should be applied to a document in sequence, into one delta.

    Composes two deltas together, that should be applied to a document in sequence, into one delta.

    that

    the second delta to be composed after this one

    returns

    the composed delta

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

    Definition Classes
    AnyRef
  11. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  13. val isDocument: Boolean

    Is the delta a "document"? If a delta contains only inserts, then it can be said that it represents the state of a document itself.

  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. val isNoOp: Boolean

    Is the delta "no-op"? In other words, is this a delta that has no effects if applied to a document or composed/transformed with another delta?

  16. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  19. def o(that: Delta): Delta

    Composes two deltas together, that should be applied to a document in sequence, into one delta.

    Composes two deltas together, that should be applied to a document in sequence, into one delta.

    that

    the second delta to be composed after this one

    returns

    the composed delta

  20. val operations: IndexedSeq[Operation]

    the list of operations in order.

    the list of operations in order. An operation can be any one of:

    • retain: advance the current position, skipping over characters
    • insert: insert characters at the current position
    • delete: delete characters at the current position
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. val targetLength: Int

    The length of the document after applying this delta.

    The length of the document after applying this delta. Equal to the length of its retain and insert operations.

  23. def toString(): String

    returns

    a string representation of the delta. For debugging purposes only.

    Definition Classes
    Delta → AnyRef → Any
  24. def transform(that: Delta, priority: Boolean = false): Delta

    Transform another delta against this one.

    Transform another delta against this one.

    This delta has priority over that delta, unless the priority flag is set to true, in which case that delta wins.

    that

    the other operation to transform this one against

    priority

    whether this delta wins contests. By default this operation is being applied _second_.

    returns

    the "that" delta, transformed

  25. def transformPosition(position: Int, priority: Boolean = false): Int

    Transform a position (ie: cursor index within a document) against this delta.

    Transform a position (ie: cursor index within a document) against this delta. For example, if a user submits their current cursor position, and other deltas have been applied more recently, their cursor position can be transformed.

  26. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. def x(that: Delta, priority: Boolean = false): Delta

    Transform two deltas applied to a document simultaneously.

    Transform two deltas applied to a document simultaneously.

    that
    returns

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped