public Value extract(Env env, ArrayValue array, @Optional("EXTR_OVERWRITE") long rawType, @Optional("NULL") Value valuePrefix )
public static Value extract(Env env, ArrayValue array, @Optional("EXTR_OVERWRITE") long rawType, @Optional("NULL") Value valuePrefix )
  public Value extract(Env env, ArrayValue array,                       @Optional("EXTR_OVERWRITE") long rawType,                       @Optional("NULL") Value valuePrefix )  {    if (array == null)      return NullValue.NULL;    long extractType = rawType & ~EXTR_REFS;    boolean extrRefs = (rawType & EXTR_REFS) != 0;    if (extractType < EXTR_OVERWRITE || extractType > EXTR_IF_EXISTS &&        extractType != EXTR_REFS) {      env.warning("Unknown extract type");      return NullValue.NULL;    }    if (extractType >= EXTR_PREFIX_SAME && extractType <= EXTR_PREFIX_IF_EXISTS &&        (valuePrefix == null || (! (valuePrefix instanceof StringValue)))) {      env.warning("Prefix expected to be specified");      return NullValue.NULL;    }    String prefix = "";    if (valuePrefix instanceof StringValue)      prefix = ((StringValue) valuePrefix).toString() + "_";    int completedSymbols = 0;    for (Value entryKey : array.keySet()) {      Value entryValue = null;      if (extrRefs)        entryValue = array.getRef(entryKey);      else        entryValue = array.get(entryKey);      Value tableValue = env.getValue(entryKey.toString());      String symbolName = entryKey.toString();      switch ((int) extractType) {      case EXTR_SKIP:        if (tableValue != NullValue.NULL)          symbolName = "";        break;      case EXTR_PREFIX_SAME:        if (tableValue != NullValue.NULL)          symbolName = prefix + symbolName;        break;      case EXTR_PREFIX_ALL:        symbolName = prefix + symbolName;        break;      case EXTR_PREFIX_INVALID:        if (! validVariableName(symbolName))          symbolName = prefix + symbolName;        break;      case EXTR_IF_EXISTS:        if (tableValue == NullValue.NULL)          entryValue = tableValue;        break;      case EXTR_PREFIX_IF_EXISTS:        if (tableValue != NullValue.NULL)          symbolName = prefix + symbolName;        else          symbolName = "";        break;      default:        break;      }      if (validVariableName(symbolName)) {        env.setValue(symbolName, entryValue);        completedSymbols++;      }    }    return LongValue.create(completedSymbols);  }