unique.js script allows printing unique lines from a file.
javadoc. It makes heavy use of regular expressions.
checkParam.js script is a useful tool to check that
@param tags in Java documentation comments match the parameters in the corresponding Java method.
The RunScript class
RunScript.java is a simple program that executes a script from the command line.
The Control class
Control.java is a program that executes a simple script and then manipulates the result.
tools package. The programs may be specified as files on the command line or by typing interactively while the shell is running.
PrimitiveWrapFactory.java is an example of a WrapFactory that can be used to control the wrapping behavior of the Rhino engine on calls to Java methods.
Multithreaded Script Execution
DynamicScopes.java is a program that creates a single global scope object and then shares it across multiple threads. Sharing the global scope allows both information to be shared across threads, and amortizes the cost of Context.initStandardObjects by only performing that expensive operation once.
Implementing Host Objects
First check out the tutorial if you haven't already.
The Foo class - Extending ScriptableObject
The Matrix class - Implementing Scriptable
Matrix.java provides a simple multidimensional array by implementing the Scriptable interface.
The File class - An advanced example