I realize this doesn't explicitly address your question (which is that you want to understand), but I wanted to recommend that you just decide not to understand.
Just implement Scriptable.get(int,Scriptable)
like this:
Object get(int index, Scriptable start) {
return this.get(String.valueOf(index),start);
}
... and stop worrying about it. This strange double-API for property access probably existed for some ancient performance reason. Remember, Rhino's roots are very old, going back to when Netscape (!) tried to rewrite Netscape Navigator (!) in Java. There is no distinction between numeric and other properties in the JavaScript standards, so in my view you're better off matching the language's behavior in your objects and not worrying about Rhino's idiosyncrasies.