Interface BreakBehaviour.Cases<R>

Enclosing class:
BreakBehaviour

public static interface BreakBehaviour.Cases<R>
  • Method Summary

    Modifier and Type
    Method
    Description
    breakOnlyIfInnerLevelsThenFitOnOneLine(boolean keepIndentWhenInlined)
    Break if by doing so all inner levels then fit on a single line.
     
    Attempt to inline the suffix of this level (which must be a Level and the last doc), recursing into the Level just before the last Level (if there is such a level) to see if that can be broken instead.
    preferBreakingLastInnerLevel(boolean keepIndentWhenInlined)
    If the last level is breakable, prefer breaking it if it will keep the rest of this level on line line.
  • Method Details

    • breakThisLevel

      R breakThisLevel()
    • preferBreakingLastInnerLevel

      R preferBreakingLastInnerLevel(boolean keepIndentWhenInlined)
      If the last level is breakable, prefer breaking it if it will keep the rest of this level on line line.
      Parameters:
      keepIndentWhenInlined - whether to keep this level's indent when inlined as a recursive level (when reached via a previous `preferBreakingLastInnerLevel` whose breakability was LastLevelBreakability.CHECK_INNER)
    • inlineSuffix

      R inlineSuffix()
      Attempt to inline the suffix of this level (which must be a Level and the last doc), recursing into the Level just before the last Level (if there is such a level) to see if that can be broken instead.

      This behaves like breakThisLevel() if we couldn't recurse into such an inner level, or if the suffix level doesn't fit on the last line.

    • breakOnlyIfInnerLevelsThenFitOnOneLine

      R breakOnlyIfInnerLevelsThenFitOnOneLine(boolean keepIndentWhenInlined)
      Break if by doing so all inner levels then fit on a single line. However, don't break if we can fit in the docs up to the first break (which might be nested inside the next doc if it's a Level), in order to prevent exceeding the maxLength accidentally.