|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.sun.speech.engine.synthesis.text.TextSynthesizer.OutputHandler
The output device for a TextSynthesizer
. Sends
all text to standard out.
Field Summary | |
protected static int |
CANCEL
|
protected static int |
CANCEL_ALL
|
protected static int |
CANCEL_COMPLETE
|
protected int |
command
For the item at the top of the queue, the output command reflects whether item should be PAUSE, RESUME, CANCEL. |
protected java.lang.Object |
commandLock
Object on which accesses to the command must synchronize. |
protected java.lang.Object |
currentItemLock
Object to lock on for setting the current item. |
protected boolean |
done
|
protected static int |
PAUSE
|
protected java.util.Vector |
queue
Internal speech output queue that will contain a set of TextSynthesizerQueueItems. |
protected static int |
RESUME
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
TextSynthesizer.OutputHandler()
Class constructor. |
Method Summary | |
void |
appendQueue(TextSynthesizerQueueItem item)
Adds an item to be spoken to the output queue. |
protected void |
cancelAllItems()
Cancels all items. |
protected void |
cancelItem()
Cancels the current item. |
protected void |
cancelItem(int cancelType)
Cancels all or just the current item. |
protected void |
cancelItem(java.lang.Object source)
Cancels the given item. |
java.util.Enumeration |
enumerateQueue()
Returns the current queue. |
protected TextSynthesizerQueueItem |
getQueueItem()
Returns, but does not remove, the first item on the queue. |
protected boolean |
isCommand(java.lang.String engineText,
int index)
Determines if the next thing in line is a command. |
boolean |
isQueueEmpty()
Determines if the queue is empty. |
protected boolean |
isWhitespace(java.lang.String engineText,
int index)
Determines if there is whitespace at the current index. |
protected int |
outputItem(TextSynthesizerQueueItem item)
Starts outputting the item. |
protected void |
pauseItem()
Pauses the output. |
protected int |
processCommand(TextSynthesizerQueueItem item,
java.lang.String engineText,
int index)
Attempts to process a command starting at the next character in the synthesizer text. |
protected int |
processNormalText(TextSynthesizerQueueItem item,
java.lang.String engineText,
int index)
Processes next set of characters in output up to whitespace or next '/' that could indicate the start of a command. |
protected int |
processWhitespace(java.lang.String engineText,
int index)
Processes whitespace at the current index in the synthesizer text. |
protected void |
resumeItem()
Resumes the output. |
void |
run()
Controls output of text until terminate is called. |
void |
terminate()
Stops execution of the Thread. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean done
protected java.util.Vector queue
BaseSynthesizerQueueItem
protected java.lang.Object currentItemLock
protected int command
protected static final int PAUSE
protected static final int RESUME
protected static final int CANCEL
protected static final int CANCEL_ALL
protected static final int CANCEL_COMPLETE
protected java.lang.Object commandLock
Constructor Detail |
public TextSynthesizer.OutputHandler()
Method Detail |
public void terminate()
public java.util.Enumeration enumerateQueue()
public boolean isQueueEmpty()
true
if the queue is emptypublic void appendQueue(TextSynthesizerQueueItem item)
item
- the item to be addedprotected void cancelItem()
protected void cancelAllItems()
protected void cancelItem(int cancelType)
cancelType
- CANCEL
or CANCEL_ALL
protected void cancelItem(java.lang.Object source)
source
- the item to cancelprotected void pauseItem()
protected void resumeItem()
public void run()
terminate()
protected TextSynthesizerQueueItem getQueueItem()
protected int outputItem(TextSynthesizerQueueItem item)
item
- to be output
protected boolean isCommand(java.lang.String engineText, int index)
engineText
- the text containing embedded commandsindex
- the current index
true
if the next thing in line is a commandprotected int processCommand(TextSynthesizerQueueItem item, java.lang.String engineText, int index)
item
- the current queue itemengineText
- the text containing embedded commandsindex
- the current index
protected boolean isWhitespace(java.lang.String engineText, int index)
engineText
- the text containing embedded commandsindex
- the current index
true
if there is whitespace at the
current indexprotected int processWhitespace(java.lang.String engineText, int index)
engineText
- the text containing embedded commandsindex
- the current index
protected int processNormalText(TextSynthesizerQueueItem item, java.lang.String engineText, int index)
item
- the current queue itemengineText
- the text containing embedded commandsindex
- the current index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |