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.
- Alphabetic
- By Inheritance
- Split
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- 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
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def activateFor(splitTag: SplitTag): Split
- val activeTags: Set[SplitTag]
- def adapt(formatToken: FormatToken): Split
- def andFirstPolicy(newPolicy: Policy): Split
- def andFirstPolicyOpt(newPolicy: => Option[Policy]): Split
- def andPolicy(newPolicy: => Policy, ignore: Boolean): Split
- def andPolicy(newPolicy: Policy): Split
- def andPolicyOpt(newPolicy: => Option[Policy]): Split
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val cost: Int
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def forThisLine(implicit line: Line): Split
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getCost(ifActive: (Int) => Int, ifIgnored: => Int): Int
- def indentation: String
- Annotations
- @inline()
- def isActive: Boolean
- Annotations
- @inline()
- def isActiveFor(splitTag: SplitTag): Boolean
- Annotations
- @inline()
- def isIgnored: Boolean
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isNL: Boolean
- Annotations
- @inline()
- def isNeededFor(splitTag: SplitTag): Boolean
- Annotations
- @inline()
- def length: Int
- Annotations
- @inline()
- implicit val line: Line
- val modExt: ModExt
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val neededTags: Set[SplitTag]
- def notIf(flag: Boolean): Split
- Annotations
- @inline()
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def onlyFor(splitTag: SplitTag, ignore: Boolean = false): Split
- def onlyIf(flag: Boolean): Split
- Annotations
- @inline()
- val optimalAt: Option[OptimalToken]
- def orPolicy(newPolicy: Policy): Split
- val policy: Policy
- def preActivateFor(splitTag: Option[SplitTag]): Split
- def preActivateFor(splitTag: SplitTag): Split
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def switch(trigger: Token): Split
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- Split → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withIndent(indent: => Indent, ignore: Boolean = false): Split
- def withIndent(length: => Length, expire: => Token, when: ExpiresOn): Split
- def withIndentOpt(indent: => Option[Indent]): Split
- def withIndentOpt(length: => Length, expire: Option[Token], when: ExpiresOn): Split
- def withIndents(indents: Seq[Indent], ignore: Boolean = false): Split
- def withMod(modExtByName: => ModExt, ignore: Boolean = false): Split
- def withMod(mod: Modification): Split
- def withOptimalAt(optimalAt: => Option[OptimalToken]): Split
- def withOptimalToken(token: => Token, killOnFail: Boolean = false, ignore: Boolean = false): Split
- def withOptimalTokenOpt(token: => Option[Token], killOnFail: Boolean = false): Split
- def withPenalty(penalty: Int): Split
- def withPolicy(newPolicy: => Policy, ignore: Boolean = false): Split
- def withPolicyOpt(newPolicy: => Option[Policy]): Split
- def withSingleLine(expire: Token, exclude: => TokenRanges = TokenRanges.empty, noSyntaxNL: Boolean = false, killOnFail: Boolean = false)(implicit line: Line): Split
- def withSingleLineAndOptimal(expire: Token, optimal: Token, exclude: => TokenRanges = TokenRanges.empty, noSyntaxNL: Boolean = false, killOnFail: Boolean = false)(implicit line: Line): Split
- def withSingleLineNoOptimal(expire: Token, exclude: => TokenRanges = TokenRanges.empty, noSyntaxNL: Boolean = false)(implicit line: Line): Split
- def withSingleLineOpt(expire: Option[Token], exclude: => TokenRanges = TokenRanges.empty, noSyntaxNL: Boolean = false, killOnFail: Boolean = false)(implicit line: Line): Split