: Class JSArray | WebReference

: Class JSArray


com.exploringxml.xml
Class JSArray

java.lang.Object
  |
  +--com.exploringxml.xml.JSArray

class JSArray
extends java.lang.Object

Mimics a Javascript array; not completely generic because only specific properties are allowed

would need Reflection to make it completely generic


Field Summary
(package private) static java.lang.String Attributes
           
(package private) static java.lang.String Contents
           
(package private) static java.lang.String Name
           
private  java.util.Vector v
           
(package private) static java.lang.String Value
           
 
Constructor Summary
(package private) JSArray()
           
 
Method Summary
(package private)  java.lang.Object elementAt(int idx)
          gets the object with a certain index
(package private)  java.lang.String join(java.lang.String sep)
          join this array into one string delimited by a separator
(package private)  int length()
          returns the length / size of the array
(package private)  void setElementAt(java.lang.Object val, int idx)
          sets the object with a certain index
(package private)  void setElementAt(java.lang.Object val, int idx, java.lang.String prop)
          sets the object with a certain index
(package private)  void split(java.lang.String str, java.lang.String sep)
          splits a string into an array of strings, broken at a distinct separator
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

v

private java.util.Vector v

Name

static final java.lang.String Name

Attributes

static final java.lang.String Attributes

Contents

static final java.lang.String Contents

Value

static final java.lang.String Value
Constructor Detail

JSArray

JSArray()
Method Detail

elementAt

java.lang.Object elementAt(int idx)
gets the object with a certain index
Parameters:
idx - the object's index in the array
Returns:
Object at the respective index

setElementAt

void setElementAt(java.lang.Object val,
                  int idx)
sets the object with a certain index
Parameters:
val - the object to be set in the array
idx - the object's index in the array

setElementAt

void setElementAt(java.lang.Object val,
                  int idx,
                  java.lang.String prop)
sets the object with a certain index
Parameters:
val - the object' property to be set
idx - the object's index in the array
prop - the name of the object's property to be set; currently can only be: name, attributes, contents, value

length

int length()
returns the length / size of the array
Returns:
the array length

split

void split(java.lang.String str,
           java.lang.String sep)
splits a string into an array of strings, broken at a distinct separator
Parameters:
str - the String to be split
sep - the seperator at which to split

join

java.lang.String join(java.lang.String sep)
join this array into one string delimited by a separator
Parameters:
sep - the seperator to put in between the array elements
Returns:
the joined String