protected class BreakingAlgorithm.BestRecords
extends java.lang.Object
Constructor and Description |
---|
BreakingAlgorithm.BestRecords()
default constructor
|
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 BreakingAlgorithm.BestRecords()
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)
fitness
- to usepublic BreakingAlgorithm.KnuthNode getNode(int fitness)
fitness
- to usepublic double getAdjust(int fitness)
fitness
- to usepublic int getAvailableShrink(int fitness)
fitness
- to usepublic int getAvailableStretch(int fitness)
fitness
- to usepublic int getDifference(int fitness)
fitness
- to usepublic double getMinDemerits()
public void reset()
Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.