|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object au.id.pbw.hyfo.hyph.HyphenBreak
public class HyphenBreak
This class represents a possible hyphenation break. It includes a Modifier
object, akin to the discretionary
break of TeX, and a weight. If the weight is an odd number between 1 and
9 inclusive, it is an hyphenation opportunity. If the weight is an even
number between 2 and 8 inclusive, it inhibits hyphenation, and if it is
0, it is neutral with respect to hyphenation.
Consequently, only odd weight values need have an associated Modifier
, although this is not enforced, as modifiers on even-numbered
weights are simply ignored.
Field Summary | |
---|---|
boolean |
check_nobreak_text
Flags this HyphenBreak as one which may have a complex break
with text replacement. |
static byte |
DEFAULT_WEIGHT
The default weight for a HyphenBreak . |
static byte |
NEUTRAL_WEIGHT
The weight for a neutral break; that is, a point which neither supports nor inhibits hyphenation. |
String |
nobreak
The text before line-breaking. |
String |
post_brkpt
The post-break text of this HyphenBreak . |
String |
pre_brkpt
The pre-break text of this HyphenBreak . |
String |
replace_post_brkpt
The replacement text following the hyphen position that replaces the post_brkpt text. |
String |
replace_pre_brkpt
The replacement text preceding the hyphen position that replaces the pre_brkpt text. |
byte |
weight
The weight of this HyphenBreak . |
Constructor Summary | |
---|---|
HyphenBreak(Alphabet alphabet)
Constructs a HyphenBreak with the default weight and default
Modifier values. |
|
HyphenBreak(byte weight,
Alphabet alphabet)
Constructs a HyphenBreak with the given weight and default
Modifier values. |
|
HyphenBreak(char ch,
Alphabet alphabet)
Constructs a HyphenBreak with a weight derived from the
given character, and default Modifier values. |
|
HyphenBreak(Modifier modifier)
Constructs a HyphenBreak with the given Modifier . |
Method Summary | |
---|---|
Byte |
get_weight()
Gets the weight of this HyphenBreak . |
String |
make_key()
Constructs a String key from the HyphenBreak . |
String |
toString()
Gets a string representation of the HyphenBreak . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final String nobreak
public final String pre_brkpt
HyphenBreak
. When hyphenation changes
the text being hyphenated, the no-break text is replaced by pre-break text
HYPHEN new-line post-break text; in this replacement, the pre_brkpt
text is replaced by the pre-break text.
public final String post_brkpt
HyphenBreak
. When hyphenation changes
the text being hyphenated, the no-break text is replaced by pre-break text
HYPHEN new-line post-break text; in this replacement, the post_brkpt
text is replaced by the post-break text.
public final String replace_pre_brkpt
pre_brkpt
text.
public final String replace_post_brkpt
post_brkpt
text.
public boolean check_nobreak_text
HyphenBreak
as one which may have a complex break
with text replacement.
public final byte weight
HyphenBreak
.
public static final byte NEUTRAL_WEIGHT
HyphenBreak
.
public static final byte DEFAULT_WEIGHT
HyphenBreak
.
Constructor Detail |
---|
public HyphenBreak(Alphabet alphabet)
HyphenBreak
with the default weight and default
Modifier
values.
alphabet
- the Alphabet
applyin.g to this HyphenBreak
.public HyphenBreak(byte weight, Alphabet alphabet) throws HyphenationException
HyphenBreak
with the given weight and default
Modifier
values.
alphabet
- the Alphabet
applyin.g to this HyphenBreak
.weight
- the weight of this HyphenBreak
.
HyphenationException
- if the weight is not
between 0 and 9, inclusive.public HyphenBreak(Modifier modifier) throws HyphenationException
HyphenBreak
with the given Modifier
. The weight is derived
from the no-break text of the Modifier
.
modifier
- the Modifier
.
HyphenationException
- if a single valid weight
cannot be derived from the no-break
text of the Modifier
.public HyphenBreak(char ch, Alphabet alphabet) throws HyphenationException
HyphenBreak
with a weight derived from the
given character, and default Modifier
values.
alphabet
- the Alphabet
applyin.g to this HyphenBreak
.ch
- the character from which to derive the weight.
HyphenationException
- if a valid weight cannot be derived from the character.Method Detail |
---|
public Byte get_weight()
HyphenBreak
.
public String make_key()
String
key from the HyphenBreak
. The key is
used in caching HyphenBreak
instances in the HyphenationTree
.
public String toString()
HyphenBreak
.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |