|
||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||
See:
Description
| Interface Summary | |
|---|---|
| ARSCIFList | The Java counterpart of an array literal. |
| ARSCIFListIterator | An universal number iterator. |
| ARSCIFMap | The Java counterpart of an object literal. |
| Class Summary | |
|---|---|
| ARSCIF | Defines static methods supporting ARSCIF. |
| ARSCIFArrayList | An implementation based on array lists of the ARSCIF list interface. |
| ARSCIFOpenHashMap | An implementation based on open hash maps of the ARSCIF map inteface. |
This package provides Java support for handling asynchronous remote-script callback invocations.
Interfacing a server-side scripting language with ARSCIF requires two essential pieces: a way to translate canonical ECMAScript literals into a variable, and a way to create a canonical ECMASCript literal out of a variable. The former is fundamental to recover the argument of a call, the latter to produce the arguments for the callback. The two processes must be rigorously inverse to each other.
As a commodity, we provide also a way to recover the argument of a call and to perform the callback.
Exchanging data with a language that has dynamic types is a bit complicated in Java: all data structures must be able to accommodate heterogeneous data.
This package provides interfaces that parallel ECMAScript arrays and ECMAScript objects, and corresponding
implementations. They allow to store heterogeneous data, but also to access
any of their element with useful methods that return directly a primitive
type (e.g., IntList.getInt(int)). The name
of the methods follow fastutil conventions.
More importantly, ARSCIFList implements
all type-specific list interfaces. This means, that, for instance,
if you know that such a list is entirely made of integers, you can just use
toIntArray() to obtain the
corresponding integer array. In fact, you can do that even if the element
of the list are just numbers (i.e., subclasses of Number)—they will be converted for you.
On the opposite side, the literal creation
methods accept any data structure implementing the List or Map interfaces (albeit in the latter
case keys must be character
sequences). Any subclass of Number will be coded as a
number, and any class implementing CharSequence will be
coded as a string.
Note that fastutil provides easy-to-use wrapping methods that makes it trivial to create lists (and thus literals) out of arrays of primitive types.
ARSCIF uses fastutil for high-performance containers and
algorithms, and MG4J for its most useful class MutableString. Note that MG4J has further
dependencies, but they are not needed if you just use MutableString.
|
||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||