01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.object.walker;
06:
07: import java.lang.reflect.Array;
08:
09: public class ArrayNode extends AbstractNode implements Node {
10:
11: private final int length;
12: private int index = 0;
13:
14: protected ArrayNode(Object o) {
15: super (o);
16: length = Array.getLength(o);
17: }
18:
19: public boolean done() {
20: return index >= length;
21: }
22:
23: public MemberValue next() {
24: return MemberValue.elementValue(index, Array.get(getObject(),
25: index++));
26: }
27:
28: }
|