private long longValue;
private JsonValue child, next, prev;
+ private int size;
public JsonValue (ValueType type) {
this.type = type;
child.prev.next = child.next;
if (child.next != null) child.next.prev = child.prev;
}
+ size--;
return child;
}
child.prev.next = child.next;
if (child.next != null) child.next.prev = child.prev;
}
+ size--;
return child;
}
/** Returns this number of children in the array or object. */
public int size () {
- JsonValue current = child;
- int size = 0;
- while (current != null) {
- size++;
- current = current.next;
- }
return size;
}
}
public void addChild (JsonValue newChild) {
+ size++;
JsonValue current = child;
if (current == null) {
child = newChild;