# HG changeset patch # User Nozomi Teruya # Date 1512640977 -32400 # Node ID 106f50cb7dd9a054d6ba59f56d596b6dc17c37b6 # Parent 33f300d0720ac07ffe3a1381c947a3fe4fbb3986 remove file diff -r 33f300d0720a -r 106f50cb7dd9 src/main/java/alice/Annotation/AliceAnnotation.java --- a/src/main/java/alice/Annotation/AliceAnnotation.java Sun Dec 03 22:09:35 2017 +0900 +++ b/src/main/java/alice/Annotation/AliceAnnotation.java Thu Dec 07 19:02:57 2017 +0900 @@ -23,10 +23,11 @@ @Peek("piyo") int piyo; + //指定したい場合 + //Receiver huge = ids.create(CommandType.TAKE); - public AliceAnnotation() { - ods.put("hoge", "hogehogehgoe"); - ods.put("piyo", 1); + public AliceAnnotation(String s){ + //huge.setKey(s);//交互にsetKeyを呼ぶことになってしまい最後のsetKeyが無効のまま走る。つまりユーザー側でsetKeyは直接呼べない } @Override @@ -34,7 +35,7 @@ System.out.println("in run!"); System.out.println(hoge); System.out.println(piyo); + //System.out.println(huge.asClass(String.class)); } - } diff -r 33f300d0720a -r 106f50cb7dd9 src/main/java/alice/Annotation/AliceAnnotationTest.java --- a/src/main/java/alice/Annotation/AliceAnnotationTest.java Sun Dec 03 22:09:35 2017 +0900 +++ b/src/main/java/alice/Annotation/AliceAnnotationTest.java Thu Dec 07 19:02:57 2017 +0900 @@ -14,6 +14,9 @@ */ public class AliceAnnotationTest { public static void main(String[] args){ - AliceAnnotation alice = new AliceAnnotation(); + AliceAnnotation alice = new AliceAnnotation("huge"); + alice.ods.put("hoge", "hogehogehoge"); + alice.ods.put("piyo", 1); + alice.ods.put("huge", "hugehugehuge"); } } diff -r 33f300d0720a -r 106f50cb7dd9 src/main/java/alice/Annotation/CS.java --- a/src/main/java/alice/Annotation/CS.java Sun Dec 03 22:09:35 2017 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -package alice.Annotation; - -import alice.codesegment.InputDataSegment; -import alice.datasegment.CommandType; -import alice.datasegment.Receiver; - -import java.util.ArrayList; - -/** - * Created by e125769 on 11/19/17. - */ -public abstract class CS { - - public ArrayList input = new ArrayList(); - public Receiver[] receivers; - public InputDataSegment ids; - - public void setInput(String[] datas){ - System.out.println("in CS!!"); - receivers = new Receiver[datas.length]; - for(int i = 0; i < datas.length; i++){ - receivers[i] = ids.create(CommandType.TAKE); - receivers[i].setKey(datas[i]); - } - } - - public void setInput(ArrayList input) { - this.input = input; - } -} diff -r 33f300d0720a -r 106f50cb7dd9 src/main/java/alice/Annotation/Data.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/Annotation/Data.java Thu Dec 07 19:02:57 2017 +0900 @@ -0,0 +1,13 @@ +package alice.Annotation; + +import java.lang.reflect.Type; + +/** + * Created by e125769 on 12/6/17. + */ +public interface Data { + Type getType(); + void setType(Type type); + T getData(); + void setData(T data); +} diff -r 33f300d0720a -r 106f50cb7dd9 src/main/java/alice/Annotation/InputData.java --- a/src/main/java/alice/Annotation/InputData.java Sun Dec 03 22:09:35 2017 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -package alice.Annotation; - -/** - * Created by e125769 on 11/15/17. - */ -public class InputData { - - private T value; - private String key; - - public InputData(T value){ - this.value = value; - } - - public T getValue() { - return value; - } - -} diff -r 33f300d0720a -r 106f50cb7dd9 src/main/java/alice/Annotation/InputProcesser.java --- a/src/main/java/alice/Annotation/InputProcesser.java Sun Dec 03 22:09:35 2017 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -package alice.Annotation; - - -import javax.annotation.processing.*; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.TypeElement; -import javax.tools.Diagnostic.Kind; -import java.util.Set; - -/** - * Created by e125769 on 10/16/17. - */ -@SupportedAnnotationTypes("alice.Annotation.Input") -public class InputProcesser extends AbstractProcessor { - - @Override - public boolean process(Set typeElements, RoundEnvironment roundEnv) { - - /*for (TypeElement typeElement : typeElements) { - Set elements = roundEnv.getElementsAnnotatedWith(typeElement); - for (Element element : elements) { - Input in = element.getAnnotation(Input.class); - System.out. println("@input" + in.input()); - } - }*/ - - return true; - } -} \ No newline at end of file diff -r 33f300d0720a -r 106f50cb7dd9 src/main/java/alice/Annotation/StringData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/Annotation/StringData.java Thu Dec 07 19:02:57 2017 +0900 @@ -0,0 +1,32 @@ +package alice.Annotation; + +import java.lang.reflect.Type; + +/** + * Created by e125769 on 12/6/17. + */ +public class StringData implements Data { + + String data; + Type type; + + @Override + public Type getType() { + return String.class; + } + + @Override + public void setType(Type type) { + this.type = type; + } + + @Override + public String getData() { + return data; + } + + @Override + public void setData(String data) { + this.data = data; + } +}