]> gerrit.simantics Code Review - simantics/platform.git/blob
0225656d5b9f3a7a584ea5811a65a8df6c4be0a9
[simantics/platform.git] /
1 package org.simantics.db.impl;
2
3 import org.simantics.db.AsyncReadGraph;
4 import org.simantics.db.RelationInfo;
5 import org.simantics.db.procedure.AsyncContextProcedure;
6
7 public final class ForPossibleRelatedValueContextProcedure<C, T> implements AsyncContextProcedure<C, T> {
8
9         public final int predicateKey;
10         public final int[] clusterKey;
11         public final int[] predicateReference;
12         public final RelationInfo info;
13         public final ClusterI.CompleteTypeEnum completeType;
14         private final AsyncContextProcedure<C, T> user;
15         
16         public ForPossibleRelatedValueContextProcedure(int predicateKey, RelationInfo info, AsyncContextProcedure<C, T> user) {
17                 this.predicateKey = predicateKey;
18                 this.completeType = ClusterTraitsBase.getCompleteTypeFromResourceKey(predicateKey); 
19                 this.info = info;
20                 this.user = user;
21                 this.clusterKey = new int[32*8];
22                 this.predicateReference = new int[32*8];
23         }
24         
25         @Override
26         public void execute(AsyncReadGraph graph, C context, T result) {
27                 user.execute(graph, context, result);
28         }
29
30         @Override
31         public void exception(AsyncReadGraph graph, Throwable throwable) {
32                 user.exception(graph, throwable);
33         }
34         
35 };