Package org.daisy.dotify.common.text
Class BreakPoint
- java.lang.Object
-
- org.daisy.dotify.common.text.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 Summary
Constructors Constructor Description BreakPoint(String head, String tail, boolean hardBreak)
Create a new BreakPoint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getHead()
Get the head part of the BreakPoint String.String
getTail()
Get the tail part of the BreakPoint String.int
hashCode()
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).
-
-
-
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 pointtail
- the part of the original String that is lefthardBreak
- set to true if a break point could not be achieved with respect for break point boundaries
-
-
Method Detail
-
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
-
-