case class Split(modExt: ModExt, cost: Int, neededTags: Set[SplitTag] = Set.empty, activeTags: Set[SplitTag] = Set.empty, policy: Policy = NoPolicy, optimalAt: Option[OptimalToken] = None)(implicit line: Line) extends Product with Serializable

A Split is the whitespace between two non-whitespace tokens.

Consider a split to be an edge in a search graph and FormatToken are the nodes.

NB: there's a historical inconsistency in how splits are sorted; when they are initially considered, cost is the primary factor (and hence, because of stable sort, earlier split with the same cost will take precedence). However, when a search state is added into the priority queue, preference is given to states with lower cost, further token and, unlike above, a LATER line defining the split.

A possible reason for the latter is to give those "secondary" splits a chance to move through the BestFirstSearch algorithm, as otherwise a sequence of primary splits might end up as the winning solution even if it exceeds the maxColumn margins, because a secondary split was deemed unlikely to win and moved to a backup priority queue.

modExt

whitespace and indents

cost

How good is this output? Lower is better.

policy

How does this split affect other later splits?

line

For debugging, to retrace from which case in Router this split originates.

Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Split
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Split(modExt: ModExt, cost: Int, neededTags: Set[SplitTag] = Set.empty, activeTags: Set[SplitTag] = Set.empty, policy: Policy = NoPolicy, optimalAt: Option[OptimalToken] = None)(implicit line: Line)

    modExt

    whitespace and indents

    cost

    How good is this output? Lower is better.

    policy

    How does this split affect other later splits?

    line

    For debugging, to retrace from which case in Router this split originates.

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. def activateFor(splitTag: SplitTag): Split
  5. val activeTags: Set[SplitTag]
  6. def adapt(formatToken: FormatToken): Split
  7. def andFirstPolicy(newPolicy: Policy): Split
  8. def andFirstPolicyOpt(newPolicy: => Option[Policy]): Split
  9. def andPolicy(newPolicy: => Policy, ignore: Boolean): Split
  10. def andPolicy(newPolicy: Policy): Split
  11. def andPolicyOpt(newPolicy: => Option[Policy]): Split
  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  14. val cost: Int
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  17. def forThisLine(implicit line: Line): Split
  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def getCost(ifActive: (Int) => Int, ifIgnored: => Int): Int
  20. def indentation: String
    Annotations
    @inline()
  21. def isActive: Boolean
    Annotations
    @inline()
  22. def isActiveFor(splitTag: SplitTag): Boolean
    Annotations
    @inline()
  23. def isIgnored: Boolean
    Annotations
    @inline()
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. def isNL: Boolean
    Annotations
    @inline()
  26. def isNeededFor(splitTag: SplitTag): Boolean
    Annotations
    @inline()
  27. def length: Int
    Annotations
    @inline()
  28. implicit val line: Line
  29. val modExt: ModExt
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. val neededTags: Set[SplitTag]
  32. def notIf(flag: Boolean): Split
    Annotations
    @inline()
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. def onlyFor(splitTag: SplitTag, ignore: Boolean = false): Split
  36. def onlyIf(flag: Boolean): Split
    Annotations
    @inline()
  37. val optimalAt: Option[OptimalToken]
  38. def orPolicy(newPolicy: Policy): Split
  39. val policy: Policy
  40. def preActivateFor(splitTag: Option[SplitTag]): Split
  41. def preActivateFor(splitTag: SplitTag): Split
  42. def productElementNames: Iterator[String]
    Definition Classes
    Product
  43. def switch(trigger: Token): Split
  44. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  45. def toString(): String
    Definition Classes
    Split → AnyRef → Any
  46. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  47. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  48. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  49. def withIndent(indent: => Indent, ignore: Boolean = false): Split
  50. def withIndent(length: => Length, expire: => Token, when: ExpiresOn): Split
  51. def withIndentOpt(indent: => Option[Indent]): Split
  52. def withIndentOpt(length: => Length, expire: Option[Token], when: ExpiresOn): Split
  53. def withIndents(indents: Seq[Indent], ignore: Boolean = false): Split
  54. def withMod(modExtByName: => ModExt, ignore: Boolean = false): Split
  55. def withMod(mod: Modification): Split
  56. def withOptimalAt(optimalAt: => Option[OptimalToken]): Split
  57. def withOptimalToken(token: => Token, killOnFail: Boolean = false, ignore: Boolean = false): Split
  58. def withOptimalTokenOpt(token: => Option[Token], killOnFail: Boolean = false): Split
  59. def withPenalty(penalty: Int): Split
  60. def withPolicy(newPolicy: => Policy, ignore: Boolean = false): Split
  61. def withPolicyOpt(newPolicy: => Option[Policy]): Split
  62. def withSingleLine(expire: Token, exclude: => TokenRanges = TokenRanges.empty, noSyntaxNL: Boolean = false, killOnFail: Boolean = false)(implicit line: Line): Split
  63. def withSingleLineAndOptimal(expire: Token, optimal: Token, exclude: => TokenRanges = TokenRanges.empty, noSyntaxNL: Boolean = false, killOnFail: Boolean = false)(implicit line: Line): Split
  64. def withSingleLineNoOptimal(expire: Token, exclude: => TokenRanges = TokenRanges.empty, noSyntaxNL: Boolean = false)(implicit line: Line): Split
  65. def withSingleLineOpt(expire: Option[Token], exclude: => TokenRanges = TokenRanges.empty, noSyntaxNL: Boolean = false, killOnFail: Boolean = false)(implicit line: Line): Split

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped