-
- final private void finish(ReadGraphImpl graph, QueryProcessor provider) {
-
- assert(isPending());
-
- synchronized(this) {
- setReady();
- }
-
- }
-
- final public void addOrSet(int add) {
-
- assert(isPending());
-
- IntArray value = (IntArray)getResult();
- value.add(add);
-
- }
-
- @Override
- public 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 value;
-
- }
-
- @Override
- public void recompute(ReadGraphImpl graph) throws DatabaseException {
-
- compute(graph, new IntProcedureAdapter() {
-
- @Override
- public void finished(ReadGraphImpl graph) {
- }
-
- @Override
- public void exception(ReadGraphImpl graph, Throwable t) {
- throw new Error("Error in recompute.", t);
- }
-
- });
-
- }