@Override public boolean hasSimple(Object ref) { if (EwJson.isValidIndex(ref)) return !isNull(ref); return false; }
@Deprecated private static boolean isObjectIndexKey(String key) { if (key == null) return false; final int delimIndex = key.indexOf(INDEX_DELIM); // One and only one colon followed by a valid index if (-1 < delimIndex && delimIndex == key.lastIndexOf(INDEX_DELIM)) { // For key "obj[0]:4", "obj[0]" is outer, "4" is inner final String innerKey = key.substring(delimIndex + 1); return !isBracketedKey(innerKey) && isValidIndex(innerKey); } return false; }
@Deprecated public static JSONArray merge(JSONArray into, JSONArray from, int startCopy, int startPut, int length) { if (into == null) return null; if (from == null) return into; if (!isValidIndex(from, startCopy)) return into; try { // Loop may break before limit final int limit = (startCopy + length); final int to = (startPut < 0) ? into.length() // Start after last // element : startPut; // Start at specified element for (int here = to, there = startCopy; there < limit; here++, there++) { if (there < from.length()) into.put(here, wrap(from.get(there))); else break; // Nothing more to copy } } catch (JSONException ex) { } return into; }
@Override public EwJsonCollection accumulate(Object ref, Object value) throws JSONException { if (!EwJson.isValidIndex(ref)) throw buildGetterException(ref, "not found"); return EwJson.accumulate(this, ref, value); }
else if (isValidIndex(key))
if (isValidIndex(key)) return ((JSONArray) object).opt(keyToIndex(key));
return EwJsonArray.merge(converted, (EwJsonCollection) wrapped, ref); else if (EwJson.isValidIndex(ref)) return converted.putOpt(ref, wrapped);