Mercurial > hg > Database > Christie
comparison src/main/java/christie/codegear/CodeGear.java @ 7:21372a589bd3
add CodeGearExecutor
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 27 Dec 2017 18:42:46 +0900 |
parents | 3dcfe63d6394 |
children | 4b608ce0c483 |
comparison
equal
deleted
inserted
replaced
6:3dcfe63d6394 | 7:21372a589bd3 |
---|---|
11 | 11 |
12 /** | 12 /** |
13 * Created by e125769 on 12/7/17. | 13 * Created by e125769 on 12/7/17. |
14 * Annotationからのinputコマンドの生成、揃ったDataGearの値を返す | 14 * Annotationからのinputコマンドの生成、揃ったDataGearの値を返す |
15 */ | 15 */ |
16 public abstract class CodeGear implements Runnable{ | 16 public abstract class CodeGear{ |
17 public InputDataGear idg = new InputDataGear(this); | 17 public InputDataGear idg = new InputDataGear(this); |
18 public OutputDataGear odg = new OutputDataGear(this); | 18 public OutputDataGear odg = new OutputDataGear(this); |
19 public ArrayList<Command> commandList = new ArrayList<Command>(); | 19 public ArrayList<Command> commandList = new ArrayList<Command>(); |
20 public CodeGearManager cgm; | 20 public CodeGearManager cgm; |
21 public DataGearManager dgm; | 21 public DataGearManager localDGM; |
22 //public CodeGearExecutor cge; | 22 public CodeGearExecutor cge; |
23 | 23 |
24 public CodeGear(CodeGearManager cgm){ | 24 public void setup(CodeGearManager cgm){ |
25 this.cgm = cgm; | 25 this.cgm = cgm; |
26 //this.cge = new CodeGearExecutor(); | 26 this.cge = new CodeGearExecutor(this, this.cgm); |
27 this.dgm = cgm.getDGM(); | 27 this.localDGM = cgm.getDGM(); |
28 } | |
29 | |
30 public void execute() {//AnnotationからInputDataGearをセット | |
31 odg.initODG(cgm); | 28 odg.initODG(cgm); |
32 | 29 |
33 for (Field field : this.getClass().getDeclaredFields()) { | 30 for (Field field : this.getClass().getDeclaredFields()) {//AnnotationからInputDataGearをセット |
34 DataGear dg = null; | 31 DataGear dg = null; |
35 try { | 32 try { |
36 dg = (DataGear) field.get(this); | 33 dg = (DataGear) field.get(this); |
37 } catch (IllegalAccessException e) { | 34 } catch (IllegalAccessException e) { |
38 e.printStackTrace(); | 35 e.printStackTrace(); |
48 } | 45 } |
49 | 46 |
50 idg.finishInput(cgm, commandList); | 47 idg.finishInput(cgm, commandList); |
51 } | 48 } |
52 | 49 |
50 protected abstract void run(CodeGearManager cgm); | |
51 | |
52 public DataGearManager dgm(String dest) { | |
53 return cgm.getDGM(dest); | |
54 } | |
53 } | 55 } |