org.apache.fop.layoutmgr
Class KnuthPenalty
public class KnuthPenalty
An instance of this class represents information about a feasible
breaking point; it does not represent any piece of content.
A KnuthPenalty is a feasible breaking point unless its value is infinity;
a KnuthPenalty whose value is -infinity represents a forced break.
A KnuthPenalty is suppressed, and its width is ignored, if it is not a
chosen breaking point; for example, a KnuthPenalty representing a
hyphenation point has a width (the "-" width), which must be ignored if
that point is not chosen as a breaking point.
Besides the inherited methods and attributes, this class has two more
attributes and the methods used to get them: the penalty value, which is
a kind of "aesthetic cost" (the higher the value, the more unsightly the
breaking point), and a boolean that marks KnuthPenalties which should not
be chosen as breaking points for consecutive lines.
KnuthPenalty(int w, int p, boolean f, int iBreakClass, Position pos, boolean bAux) - Create a new KnuthPenalty.
|
KnuthPenalty(int w, int p, boolean f, Position pos, boolean bAux) - Create a new KnuthPenalty.
|
FLAGGED_PENALTY
public static final int FLAGGED_PENALTY
Used for flagged penalties. See Knuth algorithm.
KnuthPenalty
public KnuthPenalty(int w,
int p,
boolean f,
int iBreakClass,
Position pos,
boolean bAux)
Create a new KnuthPenalty.
KnuthPenalty
public KnuthPenalty(int w,
int p,
boolean f,
Position pos,
boolean bAux)
Create a new KnuthPenalty.
w
- the width of this penaltyp
- the penalty value of this penaltyf
- is this penalty flagged?pos
- the Position stored in this penaltybAux
- is this penalty auxiliary?
getBreakClass
public int getBreakClass()
- the break class of this penalty (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE,
EN_ODD_PAGE)
getP
public int getP()
- getP in interface KnuthElement
- the penalty value of this penalty.
isFlagged
public boolean isFlagged()
- true is this penalty is a flagged one.
setBreakClass
public void setBreakClass(int cl)
Sets the break class for this penalty.
cl
- the break class (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE, EN_ODD_PAGE)
setP
public void setP(int p)
Sets a new penalty value.
p
- the new penalty value
toString
public String toString()
Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.