Package icyllis.modernui.graphics.text

# Class LineBreakConfig

java.lang.Object
icyllis.modernui.graphics.text.LineBreakConfig

public final class LineBreakConfig extends Object
Indicates the strategies can be used when calculating the text wrapping.

See the line-break property See the word-break property

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `LineBreakConfig.Builder`
  A builder for creating `LineBreakConfig`.
  `static @interface`
  `LineBreakConfig.LineBreakStyle`
  `static @interface`
  `LineBreakConfig.LineBreakWordStyle`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `LINE_BREAK_STYLE_LOOSE`
  Uses the least restrictive rule for line-breaking.
  `static final int`
  `LINE_BREAK_STYLE_NONE`
  No line break style specified.
  `static final int`
  `LINE_BREAK_STYLE_NORMAL`
  Indicates breaking text with the most common set of line-breaking rules.
  `static final int`
  `LINE_BREAK_STYLE_STRICT`
  Indicates breaking text with the most stringent line-breaking rules.
  `static final int`
  `LINE_BREAK_WORD_STYLE_BREAK_ALL`
  Allow midword breaks unless forbidden by line break style.
  `static final int`
  `LINE_BREAK_WORD_STYLE_KEEP_ALL`
  Prohibit midword breaks except for dictionary breaks.
  `static final int`
  `LINE_BREAK_WORD_STYLE_NONE`
  No line break word style specified.
  `static final int`
  `LINE_BREAK_WORD_STYLE_NORMAL`
  Normal script/language behavior for midword breaks.
  `static final int`
  `LINE_BREAK_WORD_STYLE_PHRASE`
  Indicates the line breaking is based on the phrased.
  `static final LineBreakConfig`
  `NONE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `static LineBreakConfig`
  `getLineBreakConfig(int lineBreakStyle, int lineBreakWordStyle)`
  Create the LineBreakConfig instance.
  `int`
  `getLineBreakStyle()`
  Get the line break style.
  `int`
  `getLineBreakWordStyle()`
  Get the line break word style.
  `int`
  `hashCode()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### LINE_BREAK_STYLE_NONE

    public static final int LINE_BREAK_STYLE_NONE
    No line break style specified.
    See Also:
      - Constant Field Values

  - ### LINE_BREAK_STYLE_LOOSE

    public static final int LINE_BREAK_STYLE_LOOSE
    Uses the least restrictive rule for line-breaking. Typically used for short lines.
    See Also:
      - Constant Field Values

  - ### LINE_BREAK_STYLE_NORMAL

    public static final int LINE_BREAK_STYLE_NORMAL
    Indicates breaking text with the most common set of line-breaking rules.
    See Also:
      - Constant Field Values

  - ### LINE_BREAK_STYLE_STRICT

    public static final int LINE_BREAK_STYLE_STRICT
    Indicates breaking text with the most stringent line-breaking rules.
    See Also:
      - Constant Field Values

  - ### LINE_BREAK_WORD_STYLE_NONE

    public static final int LINE_BREAK_WORD_STYLE_NONE
    No line break word style specified.
    See Also:
      - Constant Field Values

  - ### LINE_BREAK_WORD_STYLE_PHRASE

    public static final int LINE_BREAK_WORD_STYLE_PHRASE
    Indicates the line breaking is based on the phrased. This makes text wrapping only on meaningful words. The support of the text wrapping word style varies depending on the locales. If the locale does not support the phrase based text wrapping, there will be no effect.
    See Also:
      - Constant Field Values

  - ### LINE_BREAK_WORD_STYLE_NORMAL

    public static final int LINE_BREAK_WORD_STYLE_NORMAL
    Normal script/language behavior for midword breaks.
    See Also:
      - Constant Field Values

  - ### LINE_BREAK_WORD_STYLE_BREAK_ALL

    public static final int LINE_BREAK_WORD_STYLE_BREAK_ALL
    Allow midword breaks unless forbidden by line break style. To prevent overflow, word breaks should be inserted between any two characters (excluding Chinese/Japanese/Korean text).
    See Also:
      - Constant Field Values

  - ### LINE_BREAK_WORD_STYLE_KEEP_ALL

    public static final int LINE_BREAK_WORD_STYLE_KEEP_ALL
    Prohibit midword breaks except for dictionary breaks. Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.
    See Also:
      - Constant Field Values

  - ### NONE

    @Internal public static final LineBreakConfig NONE

- ## Method Details

  - ### getLineBreakConfig

    @Internal @NonNull public static LineBreakConfig getLineBreakConfig(int lineBreakStyle, int lineBreakWordStyle)
    Create the LineBreakConfig instance.
    Parameters:
      `lineBreakStyle` - the line break style for text wrapping.
      `lineBreakWordStyle` - the line break word style for text wrapping.
    Returns:
      the `LineBreakConfig` instance.

  - ### getLineBreakStyle

    public int getLineBreakStyle()
    Get the line break style.
    Returns:
      The current line break style to be used for the text wrapping.

  - ### getLineBreakWordStyle

    public int getLineBreakWordStyle()
    Get the line break word style.
    Returns:
      The current line break word style to be used for the text wrapping.

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`