Class NJSArray

java.lang.Object
org.bzdev.util.JSArray
org.bzdev.obnaming.NJSArray
All Implemented Interfaces:
Iterable<Object>, JSOps

public class NJSArray extends JSArray
Simplified JavaScript-like array (or list) class. This class extends JSArray so that it can store named objects.

Objects defined by scripting languages can be used to configure instances of NamedObjectFactory. For this use, the configuration may include lists of values. The types of the values that can be inserted into this object are NamedObjectOps, JSObject, JSArray, Boolean, Number, and String.

The class NJSUtilities.JSON can be used to create instances of NJSObject and NJSArray by reading from various sources, and instances of these two classes in turn can be used to configure a named-object factory, which can then create a named object.

This class is similar to an array list, but with some run-time type checking. Entries in the list can be other instances of JSArray (instances of NJSArray are preferred) or instances of JSObject (instances of NJSObject are preferred), in addition to strings, numbers, and boolean values, allowing trees or directed graphs to be constructed. Iterators will list the values in the order in which they were inserted.

See Also: