while (offset > 0) {
iterator.next();
offset--;
}
while (count > 0 && iterator.hasNext()) {
entries.add(new MemoryChildNodeEntry(iterator.next()));
count--;
}
offset = childNodes.size();
}
if (count > 0 && childNodeCount > MAX_CHILD_NODE_NAMES) {
String json = kernel.getNodes(
path, revision, 0, offset, all ? -1 : count, null);
JsopReader reader = new JsopTokenizer(json);
reader.read('{');
do {
String name = reader.readString();
reader.read(':');
if (reader.matches('{')) {
reader.read('}');
String childPath = getChildPath(name);
NodeState child = new KernelNodeState(
kernel, valueFactory, childPath, revision);
entries.add(new MemoryChildNodeEntry(name, child));
} else {
reader.read();
}
} while (reader.matches(','));
reader.read('}');