net.sf.mmm.util.text.api
Interface Hyphenation

All Known Implementing Classes:
HyphenationImpl

public interface Hyphenation

This is the interface for the result of a hyphenation.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Method Summary
 char getHyphen()
           
 int getHyphenation(int hyphenationIndex)
          This method gets the index of the given hyphenation-point.
 int getHyphenationBefore(int offset)
          This method gets the greatest hyphenation position that is less to the given offset.
 int getHyphenationCount()
          This method gets the number of hyphenation-points in the word.
 String getWord()
          This method gets the raw word to be hyphenated.
 String toString()
          The hyphenation of the according word (e.g. un-avail-able).
 

Method Detail

getHyphenationCount

int getHyphenationCount()
This method gets the number of hyphenation-points in the word.

Returns:
the number of hyphenation-points (e.g. 0 for "I" or "egg" or 1 for "im-pact").

getHyphenation

int getHyphenation(int hyphenationIndex)
This method gets the index of the given hyphenation-point.

Parameters:
hyphenationIndex - is the index of the hyphenation-point in the range from 0 to getHyphenationCount() - 1.
Returns:
the index of the position in the word.

getHyphenationBefore

int getHyphenationBefore(int offset)
This method gets the greatest hyphenation position that is less to the given offset.

Parameters:
offset - is the offset in the word where a hyphenation is desired.
Returns:
the hyphenation position just before the given offset or -1 if there is no such position.

getWord

String getWord()
This method gets the raw word to be hyphenated.

Returns:
the word without added hyphens.

getHyphen

char getHyphen()
Returns:
the hyphen character.
See Also:
Hyphenator.getHyphen()

toString

String toString()
The hyphenation of the according word (e.g. un-avail-able).

Overrides:
toString in class Object


Copyright © 2001-2010 mmm-Team. All Rights Reserved.