Interface PhonScript
- All Superinterfaces:
Appendable,CharSequence,IExtendable
- All Known Implementing Classes:
BasicScript,LazyQueryScript,QueryScript
Interface for Phon runtime scripts. Scripts are written in ECMAScript and use the Rhino engine directly (instead of using the JSR.)
Phon scripts may also have parameters defined which can be
setup using either a comment at the beginning of the file or
by implementing the setup_params function in the
script.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddClassImport(String classImport) booleanaddPackageImport(String pkgImport) booleanaddRequirePath(URI uri) append(boolean arg0) append(char c) append(char[] str) append(char[] str, int offset, int len) append(double d) append(float f) append(int i) append(long lng) append(CharSequence s, int start, int end) append(StringBuffer sb) appendCodePoint(int codePoint) intcapacity()charcharAt(int index) intcodePointAt(int index) intcodePointBefore(int index) intcodePointCount(int beginIndex, int endIndex) delete(int start, int end) deleteCharAt(int index) voidensureCapacity(int minimumCapacity) voidgetChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) Get a list of classes that should be imported when the scope is created.Get a script context for this script.Get required packages that should be imported when the scope is created.Get the list of URLs that should be available for script loading using therequirefunction.Get the script text.intintinsert(int offset, boolean b) insert(int offset, char c) insert(int offset, char[] str) insert(int index, char[] str, int offset, int len) insert(int offset, double d) insert(int offset, float f) insert(int offset, int i) insert(int offset, long l) insert(int dstOffset, CharSequence s) insert(int dstOffset, CharSequence s, int start, int end) intlastIndexOf(String str) intlastIndexOf(String str, int fromIndex) intlength()intoffsetByCodePoints(int index, int codePointOffset) booleanremoveClassImport(String classImport) booleanremovePackageImport(String pkgImport) booleanremoveRequirePath(URI uri) Reset contextreverse()voidsetCharAt(int index, char ch) voidsetLength(int newLength) subSequence(int start, int end) substring(int start) substring(int start, int end) voidMethods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty, toStringMethods inherited from interface ca.phon.extensions.IExtendable
getExtension, getExtensions, putExtension, removeExtension
-
Method Details
-
getScript
-
resetContext
PhonScriptContext resetContext()Reset context -
getContext
PhonScriptContext getContext()Get a script context for this script. The context is used to compile and evaulate the script.- Returns:
- the script context
-
getPackageImports
-
addPackageImport
-
removePackageImport
-
getClassImports
-
addClassImport
-
removeClassImport
-
getRequirePaths
-
addRequirePath
-
removeRequirePath
-
append
-
append
- Specified by:
appendin interfaceAppendable
-
append
-
append
-
append
- Specified by:
appendin interfaceAppendable
-
append
- Specified by:
appendin interfaceAppendable
-
append
-
append
-
append
-
append
-
append
-
append
-
append
-
appendCodePoint
-
capacity
int capacity() -
charAt
char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
codePointAt
int codePointAt(int index) -
codePointBefore
int codePointBefore(int index) -
codePointCount
int codePointCount(int beginIndex, int endIndex) -
delete
-
deleteCharAt
-
ensureCapacity
void ensureCapacity(int minimumCapacity) -
getChars
void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) -
indexOf
-
indexOf
-
insert
-
insert
-
insert
-
insert
-
insert
-
insert
-
insert
-
insert
-
insert
-
insert
-
insert
-
insert
-
lastIndexOf
-
lastIndexOf
-
length
int length()- Specified by:
lengthin interfaceCharSequence
-
offsetByCodePoints
int offsetByCodePoints(int index, int codePointOffset) -
replace
-
reverse
PhonScript reverse() -
setCharAt
void setCharAt(int index, char ch) -
setLength
void setLength(int newLength) -
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
substring
-
substring
-
trimToSize
void trimToSize()
-