Methods Summary |
---|
public boolean | hasNext()Returns true if the iteration has more elements. (In other words,
returns true if next would return an
element rather than throwing an exception.)
boolean ret = false;
if (isValid()) {
ret = ptHasCompletionOption0(handle);
}
return ret;
|
public boolean | isValid()check if current handle is valid
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION, LogChannels.LC_HIGHUI,
"isValid = " + (handle != 0));
}
return handle > 0;
|
public java.lang.String | next()Returns the next element in the iteration.
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION, LogChannels.LC_HIGHUI,
"[iter.nextCompletionOption] >>");
}
String ret = null;
if (isValid()) {
ret = ptNextCompletionOption0(handle, entry.length);
}
if (ret == null)
ret = "";
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION, LogChannels.LC_HIGHUI,
"[iter.nextCompletionOption] : " + ret);
}
return ret;
|
public void | nextLevel(int keyCode)Adds a key to current completion string
if (isValid()) {
ptAddKey0(handle, keyCode);
}
|
public void | prevLevel()Backspace on key in current completion string.
if (isValid()) {
ptDeleteKey0(handle);
}
|
private static native boolean | ptAddKey0(int handle, int keyCode)Advances the predictive text iterator using the next key code
|
private static native boolean | ptClear0(int handle)Clear all text from the predictive text iterator
|
private static native boolean | ptDeleteKey0(int handle)Backspace the iterator one key
|
private static native boolean | ptHasCompletionOption0(int handle)see if exist further completion options for the current
predictive text entry
|
private static native int | ptNewIterator0(int dictionary)Create a new iterator instance
|
private static native java.lang.String | ptNextCompletionOption0(int handle, int outMaxSize)return the current predictive text completion option
|
private static native boolean | ptRenewCompletionOptions0(int handle)reset completion options for for the current predictive text entry
After this call, ptNextCompletionOption() will return all
completion options starting from 1st one.
|
public void | reset()create a new handle and clear completion state by
calling ptNewIterator0()
ptClear0(handle);
|
public void | resetNext()Reverts to first possible completion.
If next() has been called uptil hasNext() returns false, then after
calling reviewCompletionOptions(), calling next() will return
the 1st completion
if (isValid()) {
ptRenewCompletionOptions0(handle);
}
|