Mercurial > hg > Database > Christie
diff src/main/java/christie/codegear/CodeGear.java @ 2:bacdcb5e6dcf
change StartCodeGear static
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 12 Dec 2017 16:48:30 +0900 |
parents | 3ea61d0bfc34 |
children | e3bb0eea73f2 |
line wrap: on
line diff
--- a/src/main/java/christie/codegear/CodeGear.java Mon Dec 11 21:19:25 2017 +0900 +++ b/src/main/java/christie/codegear/CodeGear.java Tue Dec 12 16:48:30 2017 +0900 @@ -16,12 +16,15 @@ public interface CodeGear extends Runnable{ InputDataGear idg = new InputDataGear(); OutputDataGear odg = new OutputDataGear(); - //CodeGearManager cgm = null; ArrayList<Command> commandList = new ArrayList<Command>(); - default void setKey(CodeGearManager cgm){//AnnotationからInputDataGearをセット + default void start(CodeGearManager cgm){//AnnotationからInputDataGearをセット + odg.initODG(cgm, this); for (Field field : this.getClass().getDeclaredFields()) { if (field.isAnnotationPresent(Take.class)){//何故かここに入らない + if (!field.getType().isInterface()){ + System.out.println("DataGearではありません"); + } Take ano = field.getAnnotation(Take.class); System.out.println(ano.value()); commandList.add(new Command(this, null, "local", ano.value(), CommandType.TAKE)); @@ -30,13 +33,13 @@ idg.finishInput(cgm, this, commandList); } - default void setValue(){//Annotationから揃ったInputDataGearの値をキャスト + default void setInputValue(){//Annotationから揃ったInputDataGearの値をキャスト for (Field field : this.getClass().getDeclaredFields()) { field.setAccessible(true); if (field.isAnnotationPresent(Take.class)){ Take ano = field.getAnnotation(Take.class); try { - field.set(this, idg.inputs.get(ano.value()));//ダウンキャストできるか? + field.set(this, idg.inputValue.get(ano.value()));//ダウンキャストできるか? } catch (IllegalAccessException e) { e.printStackTrace(); } @@ -45,11 +48,11 @@ } default void put(String key, Object data){ - //cgm.getDGM("local").put(key, new DataGear(data)); + odg.put(key, data); } default void put(String dist, String key, Object data){ - //cgm.getDGM(dist).put(key, new DataGear(data)); + odg.put(dist, key, data); } }