Unified Typesetting API M1-20040817

de.inghuimische.uta.linebreaking
Interface Breakpoint

All Known Implementing Classes:
AbstractBreakpoint

public interface Breakpoint

A breakpoint determines a line in a paragraph.

It is the job of a linebreak algorithm to generate such possible breakpoints.

A breakpoint references zero or more previous breakpoints.

Author:
Christian Ziesemer

Method Summary
 void addPreviousBreakpoint(Breakpoint prevBp, Line edge)
          Links this breakpoint to its predecessor assigning the cost to come from the previous point to this one (specified by demerits).
 double getDemerits(Breakpoint previousBreakpoint)
          Returns the demerits associated with this breakpoint in relation to the given previous breakpoint.
 Item getItem()
          Returns the item this breakpoint breaks after.
 Line getLine(Breakpoint prevBP)
          Returns the line this breakpoint determinates.
 List getPreviousBreakpoints()
          Returns a list of all previous breakpoints.
 

Method Detail

getDemerits

public double getDemerits(Breakpoint previousBreakpoint)
Returns the demerits associated with this breakpoint in relation to the given previous breakpoint.

Parameters:
previousBreakpoint - The previous breakpoint
Returns:
The demerits occurring between previous breakpoint and this one.

getLine

public Line getLine(Breakpoint prevBP)
Returns the line this breakpoint determinates.

Returns:
The line this breakpoint determinates.

getPreviousBreakpoints

public List getPreviousBreakpoints()
Returns a list of all previous breakpoints.

Returns:
A list of all previous breakpoints.

getItem

public Item getItem()
Returns the item this breakpoint breaks after. This is the item immediatly before this breakpoint.

Returns:
The item this breakpoint breaks after.

addPreviousBreakpoint

public void addPreviousBreakpoint(Breakpoint prevBp,
                                  Line edge)
Links this breakpoint to its predecessor assigning the cost to come from the previous point to this one (specified by demerits).

While simple linebreak algorithms may not build more than a list of breakpoints, complex algorithms mostly will build a tree or graph of such points.

Parameters:
prevBp - The previous breakpoint to link to.
edge - The line linking prevBp with this one.

Unified Typesetting API M1-20040817


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