-
- final static IntSet runner2(ReadGraphImpl graph, final int r, final QueryProcessor provider, final CacheEntry parent, final ListenerBase listener, final InternalProcedure<IntSet> procedure) throws Throwable {
-
- SuperRelations entry = (SuperRelations)provider.superRelationsMap.get(r);
- if(entry == null) {
-
- entry = new SuperRelations(r);
- entry.setPending();
- entry.clearResult(provider.querySupport);
- entry.putEntry(provider);
-
- return (IntSet)provider.performForEach2(graph, entry, parent, listener, procedure);
-
- } else {
-
- if(!entry.isReady()) {
- throw new IllegalStateException();
- }
- return (IntSet)provider.performForEach2(graph, entry, parent, listener, procedure);
-
- }
-
- }
-
- final public static void queryEach(ReadGraphImpl graph, final int r, final QueryProcessor provider, final CacheEntry parent, final ListenerBase listener, final InternalProcedure<IntSet> procedure) {
-
- if(parent == null && listener == null) {
- SuperRelations entry = (SuperRelations)provider.superRelationsMap.get(r);
- if(entry != null && entry.isReady()) {
- entry.performFromCache(graph, provider, procedure);
- return;
- }
- }
-
- runner(graph, r, provider, parent, listener, procedure);
-
- }
-
- final public static IntSet queryEach2(ReadGraphImpl graph, final int r, final QueryProcessor provider, final CacheEntry parent, final ListenerBase listener, final InternalProcedure<IntSet> procedure) throws Throwable {
-
- if(parent == null && listener == null) {
- SuperRelations entry = (SuperRelations)provider.superRelationsMap.get(r);
- if(entry != null && entry.isReady()) {
- return (IntSet)entry.get(graph, provider, procedure);
- }
- }
-
- return runner2(graph, r, provider, parent, listener, procedure);
-
- }
-
- @Override
- public UnaryQuery<InternalProcedure<IntSet>> getEntry(QueryProcessor provider) {
- return provider.superRelationsMap.get(id);
- }
-
- @Override
- public void putEntry(QueryProcessor provider) {
- provider.superRelationsMap.put(id, this);
- }