Class BreakPoint


  • public class BreakPoint
    extends Object

    A BreakPoint is a data object to keep the information about a break point result. Since this implementation uses two Strings, rather than the original String and an integer for the break point position, it can be used with non standard hyphenation algorithms.

    • Constructor Detail

      • BreakPoint

        public BreakPoint​(String head,
                          String tail,
                          boolean hardBreak)
        Create a new BreakPoint.
        Parameters:
        head - the part of the original String that fits within the target break point
        tail - the part of the original String that is left
        hardBreak - set to true if a break point could not be achieved with respect for break point boundaries
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getHead

        public String getHead()
        Get the head part of the BreakPoint String.
        Returns:
        returns the head part of the BreakPoint String
      • getTail

        public String getTail()
        Get the tail part of the BreakPoint String.
        Returns:
        returns the tail part of the BreakPoint String
      • isHardBreak

        public boolean isHardBreak()
        Test if this BreakPoint was achieved by breaking on a character other than a valid break point character (typically hyphen, soft hyphen or space).
        Returns:
        returns true if this BreakPoint was achieved by breaking on a character other than hyphen, soft hyphen or space