|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dante.extex.language.impl.FutureLanguage
This class implements the future pattern for a language object. The real object creation or loading is delayed until it is clear whether the loading or the creation should be performed.
Field Summary | |
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
Constructor Summary | |
FutureLanguage(java.lang.String index,
LanguageCreator creator)
Creates a new object. |
Method Summary | |
void |
addHyphenation(UnicodeCharList word,
TypesetterOptions context)
Add a user-defined hyphenation. |
void |
addPattern(Tokens pattern)
Add a pattern to the hyphenation table. |
int |
findWord(NodeList nodes,
int start,
UnicodeCharList word)
Extract a word from a node list. |
long |
getLeftHyphenmin()
Return the value for the minimum number of characters before a hyphenation on the left hand side of a word. |
UnicodeChar |
getLigature(UnicodeChar c1,
UnicodeChar c2,
Font f)
Get a single ligature of to characters. |
java.lang.String |
getName()
Getter for the name. |
long |
getRightHyphenmin()
Return the value for the minimum number of characters before a hyphenation on the right hand side of a word. |
boolean |
hyphenate(NodeList nodelist,
TypesetterOptions context,
UnicodeChar hyphen,
int start,
boolean forall,
NodeFactory nodeFactory)
Insert the hyphenation marks for a horizontal list of nodes. |
int |
insertLigatures(NodeList list,
int start)
Take a node list and transform character sequences into ligatures where appropriate. |
void |
insertShy(NodeList nodes,
int insertionPoint,
boolean[] spec,
CharNode hyphenNode)
Insert hyphenation points into a list of nodes. |
boolean |
isHyphenActive()
Return true , if hyphenation is active,
otherwise false ; |
UnicodeCharList |
normalize(UnicodeCharList word,
TypesetterOptions options)
Normalize a word for the lookup. |
protected java.lang.Object |
readResolve()
Magic method for deserialization. |
void |
setCreator(LanguageCreator creator)
Setter for the creator. |
void |
setHyphenActive(boolean active)
Activate or deactivate the hyphenation for this language. |
void |
setLeftHyphenmin(long left)
Set the value for the minimum number of characters before a hyphenation on the left hand side of a word. |
void |
setName(java.lang.String name)
Setter for the name. |
void |
setRightHyphenmin(long right)
Set the value for the minimum number of characters before a hyphenation on the right hand side of a word. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final long serialVersionUID
Constructor Detail |
public FutureLanguage(java.lang.String index, LanguageCreator creator)
index
- the name of the language for the creatorcreator
- the creator which should be contacted to perform the
real taskMethod Detail |
public void addHyphenation(UnicodeCharList word, TypesetterOptions context) throws HyphenationException
Hyphenator
The hyphenation template consists of a word of characters. The Unicode soft hyphenation character has a special meaning. This character is used to indicate places where a hyphenation is permitted. The other characters – i.e. normal Unicode characters – are used as-is.
addHyphenation
in interface Hyphenator
word
- the word with the hyphenation markscontext
- the interpreter context
HyphenationException
- in case of an errorHyphenator.addHyphenation(
de.dante.util.UnicodeCharList,
de.dante.extex.typesetter.TypesetterOptions)
public void addPattern(Tokens pattern) throws HyphenationException
Hyphenator
addPattern
in interface Hyphenator
pattern
- the pattern word with numbers
HyphenationException
- in case of an errorHyphenator.addPattern(
de.dante.extex.interpreter.type.tokens.Tokens)
public int findWord(NodeList nodes, int start, UnicodeCharList word) throws HyphenationException
WordTokenizer
findWord
in interface WordTokenizer
nodes
- the nodes to extract the word fromstart
- the start indexword
- the target list for the letters of the word
HyphenationException
- in case of an errorWordTokenizer.findWord(
de.dante.extex.typesetter.type.NodeList,
int,
de.dante.util.UnicodeCharList)
public long getLeftHyphenmin() throws HyphenationException
Hyphenator
getLeftHyphenmin
in interface Hyphenator
HyphenationException
- in case of an errorHyphenator.getLeftHyphenmin()
public UnicodeChar getLigature(UnicodeChar c1, UnicodeChar c2, Font f) throws HyphenationException
LigatureBuilder
getLigature
in interface LigatureBuilder
c1
- the first characterc2
- the second characterf
- the current font
null
if none exists
HyphenationException
- in case of an errorLigatureBuilder.getLigature(
de.dante.util.UnicodeChar,
de.dante.util.UnicodeChar,
de.dante.extex.interpreter.type.font.Font)
public java.lang.String getName()
Language
getName
in interface Language
Language.getName()
public long getRightHyphenmin() throws HyphenationException
Hyphenator
getRightHyphenmin
in interface Hyphenator
HyphenationException
- in case of an errorHyphenator.getRightHyphenmin()
public boolean hyphenate(NodeList nodelist, TypesetterOptions context, UnicodeChar hyphen, int start, boolean forall, NodeFactory nodeFactory) throws HyphenationException
Hyphenator
hyphenate
in interface Hyphenator
nodelist
- the horizontal node listcontext
- the contexthyphen
- the tokens to be inserted for hyphensstart
- the start indexforall
- the indicator that all words to the end should be
processed. if false
then only the next word is hyphenated.nodeFactory
- the node factory
true
iff the hyphenator is responsible for this
word. Usually this means that some hyphenation marks have been inserted.
HyphenationException
- in case of an errorHyphenator.hyphenate(
de.dante.extex.typesetter.type.NodeList,
de.dante.extex.typesetter.TypesetterOptions,
de.dante.util.UnicodeChar,
int,
boolean,
de.dante.extex.typesetter.type.node.factory.NodeFactory)
public int insertLigatures(NodeList list, int start) throws HyphenationException
LigatureBuilder
insertLigatures
in interface LigatureBuilder
list
- the node list to create ligatures forstart
- the index in the list to start processing
HyphenationException
- in case of an errorLigatureBuilder.insertLigatures(
de.dante.extex.typesetter.type.NodeList, int)
public void insertShy(NodeList nodes, int insertionPoint, boolean[] spec, CharNode hyphenNode) throws HyphenationException
WordTokenizer
insertShy
in interface WordTokenizer
nodes
- the node list to modifyinsertionPoint
- the index to insert something into the nodesspec
- the specification where to insert hyphenation marks.
If spec[i]
is true
then a hyphen needs to be
inserted before the ith character at or after insertionPoint
in nodeshyphenNode
- the hyphen as node
HyphenationException
- in case of an errorWordTokenizer.insertShy(
de.dante.extex.typesetter.type.NodeList,
int,
boolean[],
de.dante.extex.typesetter.type.node.CharNode)
public boolean isHyphenActive() throws HyphenationException
Hyphenator
true
, if hyphenation is active,
otherwise false
;
isHyphenActive
in interface Hyphenator
true
iff the hyphenation for this language is
enabled
HyphenationException
- in case of an errorHyphenator.isHyphenActive()
public UnicodeCharList normalize(UnicodeCharList word, TypesetterOptions options) throws HyphenationException
WordTokenizer
normalize
in interface WordTokenizer
word
- the word to normalizeoptions
- the options to use
HyphenationException
- in case of an errorWordTokenizer.normalize(
de.dante.util.UnicodeCharList,
de.dante.extex.typesetter.TypesetterOptions)
protected java.lang.Object readResolve() throws java.io.ObjectStreamException
java.io.ObjectStreamException
- in case of an errorpublic void setCreator(LanguageCreator creator)
ManagedLanguage
setCreator
in interface ManagedLanguage
creator
- the managerde.dante.extex.language.impl.ManagedLanguage#setCreator(
de.dante.extex.language.LanguageManager)
public void setHyphenActive(boolean active) throws HyphenationException
Hyphenator
setHyphenActive
in interface Hyphenator
active
- the indicator that the hyphenation is activated
HyphenationException
- in case of an errorHyphenator.setHyphenActive(boolean)
public void setLeftHyphenmin(long left) throws HyphenationException
Hyphenator
setLeftHyphenmin
in interface Hyphenator
left
- the new value
HyphenationException
- in case of an errorHyphenator.setLeftHyphenmin(long)
public void setName(java.lang.String name)
Language
setName
in interface Language
name
- the nameLanguage.setName(java.lang.String)
public void setRightHyphenmin(long right) throws HyphenationException
Hyphenator
setRightHyphenmin
in interface Hyphenator
right
- the new value
HyphenationException
- in case of an errorHyphenator.setRightHyphenmin(long)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |