Unified Typesetting API M1-20040817

Interface LinebreakAlgorithm

All Superinterfaces:
All Known Implementing Classes:

public interface LinebreakAlgorithm
extends QManageable

A linebreak algorithm breaks one line of text into several ones with each of them having a given length. Such an algorithm can either work line based, finding the local optimum of a line width or paragraph based, searching for a global optimum of linebreaks.

A linebreak algorithm receives a sequence of socalled items, where each Item can contain anything (the linebreak algorithm is not interested in the content) and a linebreak is allowed behind every such item. Therefore an item will most commonly represent a word or a syllable. An item will in most cases also the sourrounding whitespace although this is not required. You can also put every whitespace in a item of its own.

The LineWidthModel provides the line width for every single line. The consider(Item) method called from outside informs the linebreaker of a new item. A call to getBreakpoints() finishes the linebreaking and returns the calculated breakpoints.

Have a look into Feature for features a linebreaker can support. Implementations have to provide a list of features.

Christian Ziesemer

Method Summary
 void consider(Item newItem)
          Tells the line breaker that he has to consider a newly generated item.
 List getBreakpoints()
          Returns the generated breakpoints.
 FeatureList getFeatures()
          Returns a list of supported features.
 LineWidthModel getLineWidthModel()
          Returns the line width model used.
 void setLineWidthModel(LineWidthModel aModel)
          Sets the line width model.

Method Detail


public void setLineWidthModel(LineWidthModel aModel)
Sets the line width model. The model is used to allow varying line width.

aModel - The model to use.


public LineWidthModel getLineWidthModel()
Returns the line width model used.

The line width model used.


public FeatureList getFeatures()
Returns a list of supported features.

Specified by:
getFeatures in interface QManageable
A list of supported features.


public void consider(Item newItem)
Tells the line breaker that he has to consider a newly generated item. This allows implementations which do typesetting and linebreaking simultaneous.

newItem - The new Item to consider.


public List getBreakpoints()
Returns the generated breakpoints. Calling this method only makes sense if no further calls to consider(Item) are made.

The generated breakpoints.

Unified Typesetting API M1-20040817

An inghuimische.de project.
Copyright (C) 2004 Christian Ziesemer; See the Mozilla Public License for more details.