protected class BreakingAlgorithm.BestRecords
extends java.lang.Object
Constructor and Description |
---|
BreakingAlgorithm.BestRecords() |
Modifier and Type | Method and Description |
---|---|
void |
addRecord(double demerits,
BreakingAlgorithm.KnuthNode node,
double adjust,
int availableShrink,
int availableStretch,
int difference,
int fitness)
Registers the new best active node for the given fitness class.
|
double |
getAdjust(int fitness) |
int |
getAvailableShrink(int fitness) |
int |
getAvailableStretch(int fitness) |
double |
getDemerits(int fitness) |
int |
getDifference(int fitness) |
double |
getMinDemerits() |
BreakingAlgorithm.KnuthNode |
getNode(int fitness) |
boolean |
hasRecords() |
boolean |
notInfiniteDemerits(int fitness) |
void |
reset()
Reset when a new breakpoint is being considered.
|
public void addRecord(double demerits, BreakingAlgorithm.KnuthNode node, double adjust, int availableShrink, int availableStretch, int difference, int fitness)
demerits
- the total demerits of the new optimal set of breakpointsnode
- the node starting the line ending at the current elementadjust
- adjustment ratio of the current lineavailableShrink
- how much the current line can be shrinkedavailableStretch
- how much the current line can be stretcheddifference
- difference between the width of the considered line and the
width of the "real" linefitness
- fitness class of the current linepublic boolean hasRecords()
public boolean notInfiniteDemerits(int fitness)
fitness
- fitness class (0, 1, 2 or 3, i.e. "tight" to "very loose")public double getDemerits(int fitness)
public BreakingAlgorithm.KnuthNode getNode(int fitness)
public double getAdjust(int fitness)
public int getAvailableShrink(int fitness)
public int getAvailableStretch(int fitness)
public int getDifference(int fitness)
public double getMinDemerits()
public void reset()
Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.