fop 1.0

org.apache.fop.layoutmgr
Class BreakingAlgorithm.BestRecords

java.lang.Object
  extended by org.apache.fop.layoutmgr.BreakingAlgorithm.BestRecords
Enclosing class:
BreakingAlgorithm

protected class BreakingAlgorithm.BestRecords
extends java.lang.Object

Class that stores, for each fitness class, the best active node that could start a line of the corresponding fitness ending at the current element.


Constructor Summary
BreakingAlgorithm.BestRecords()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BreakingAlgorithm.BestRecords

public BreakingAlgorithm.BestRecords()
Method Detail

addRecord

public 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.

Parameters:
demerits - the total demerits of the new optimal set of breakpoints
node - the node starting the line ending at the current element
adjust - adjustment ratio of the current line
availableShrink - how much the current line can be shrinked
availableStretch - how much the current line can be stretched
difference - difference between the width of the considered line and the width of the "real" line
fitness - fitness class of the current line

hasRecords

public boolean hasRecords()

notInfiniteDemerits

public boolean notInfiniteDemerits(int fitness)
Parameters:
fitness - fitness class (0, 1, 2 or 3, i.e. "tight" to "very loose")
Returns:
true if there is a set of feasible breakpoints registered for the given fitness.

getDemerits

public double getDemerits(int fitness)

getNode

public BreakingAlgorithm.KnuthNode getNode(int fitness)

getAdjust

public double getAdjust(int fitness)

getAvailableShrink

public int getAvailableShrink(int fitness)

getAvailableStretch

public int getAvailableStretch(int fitness)

getDifference

public int getDifference(int fitness)

getMinDemerits

public double getMinDemerits()

reset

public void reset()
Reset when a new breakpoint is being considered.


fop 1.0

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.