protected JSONArray(JSONTokener x){
  this();
  if (x.nextClean() != '[') {
    throw new RuntimeException("A JSONArray text must start with '['");
  }
  if (x.nextClean() != ']') {
    x.back();
    for (; ; ) {
      if (x.nextClean() == ',') {
        x.back();
        myArrayList.add(JSONObject.NULL);
      }
 else {
        x.back();
        myArrayList.add(x.nextValue());
      }
switch (x.nextClean()) {
case ';':
case ',':
        if (x.nextClean() == ']') {
          return;
        }
      x.back();
    break;
case ']':
  return;
default :
throw new RuntimeException("Expected a ',' or ']'");
}
}
}
}

protected JSONArray ( JSONTokener x ) { this ( ) ; if ( x . nextClean ( ) != '[' ) { throw new RuntimeException ( "A JSONArray text must start with '['" ) ; } if ( x . nextClean ( ) != ']' ) { x . back ( ) ; for ( ; ; ) { if ( x . nextClean ( ) == ',' ) { x . back ( ) ; myArrayList . add ( JSONObject . NULL ) ; } else { x . back ( ) ; myArrayList . add ( x . nextValue ( ) ) ; } switch ( x . nextClean ( ) ) { case ';' : case ',' : if ( x . nextClean ( ) == ']' ) { return ; } x . back ( ) ; break ; case ']' : return ; default : throw new RuntimeException ( "Expected a ',' or ']'" ) ; } } } }
construct a jsonarray from a jsontokener .
