public class BasicTextDecoder extends java.lang.Object implements TextDecoder
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
decodedText |
protected long |
lastUpdateTime |
protected java.lang.String |
text |
Constructor and Description |
---|
BasicTextDecoder() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
decode(java.lang.String textToDecode)
Decode the text.
|
java.lang.String |
getDecodedText()
Get the decoded text.
|
long |
getLastUpdateTime()
Get the time at which the decoded text last changed.
|
void |
setText(java.lang.String input)
Set the input text which the decoder will process.
|
protected java.lang.String decodedText
protected long lastUpdateTime
protected java.lang.String text
protected java.lang.String decode(java.lang.String textToDecode)
textToDecode
- The text to decode.public java.lang.String getDecodedText()
getDecodedText
in interface TextDecoder
public long getLastUpdateTime()
The update time does not change until TextDecoder.getDecodedText()
is called. An application should call
TextDecoder.getDecodedText()
, and then call this method to compare the timestamp with some previous timestamp to
determine if the decoded text has changed since TextDecoder.getDecodedText()
was last called.
getLastUpdateTime
in interface TextDecoder
System.currentTimeMillis()
) at which the decoded text last changed.
Returns zero if called before the text is decoded.public void setText(java.lang.String input)
setText
in interface TextDecoder
input
- Text to decode.