+ @Override
+ public final Object performFromCache(ReadGraphImpl graph, final IntProcedure procedure) throws DatabaseException {
+
+ assert(isReady());
+
+ if(handleException(graph, procedure)) return EXCEPTED;
+
+ final IntArray value = (IntArray)getResult();
+ if(value.data == null) {
+ if(value.sizeOrData != IntArray.NO_DATA) procedure.execute(graph, value.sizeOrData);
+ } else {
+ for(int i = 0;i < value.sizeOrData ; i++) procedure.execute(graph, value.data[i]);
+ }
+
+ procedure.finished(graph);
+
+ return getResult();
+
+ }
+
+ @Override
+ public final void recompute(ReadGraphImpl graph) throws DatabaseException {
+
+ compute(graph, new IntProcedureAdapter() {
+
+ @Override
+ public void finished(ReadGraphImpl graph) {
+ }
+
+ @Override
+ public void exception(ReadGraphImpl graph, Throwable t) {
+ new Error("Error in recompute.", t).printStackTrace();
+ }
+
+ });
+
+ }
+
+ @Override
+ final boolean isImmutable(ReadGraphImpl graph) {
+ return graph.processor.isImmutable(id);
+ }
+
+ @Override
+ public final void execute(ReadGraphImpl graph, int i) throws DatabaseException {
+ IntArray v = (IntArray)getResult();
+ v.add(i);
+ }
+
+ @Override
+ public final void finished(ReadGraphImpl graph) throws DatabaseException {
+ setReady();
+ }
+
+ @Override
+ public final void exception(ReadGraphImpl graph, Throwable throwable) throws DatabaseException {
+ except(throwable);
+ }
+