Mercurial > hg > Database > Alice
changeset 637:106f50cb7dd9
remove file
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 07 Dec 2017 19:02:57 +0900 |
parents | 33f300d0720a |
children | 3e00000949aa |
files | src/main/java/alice/Annotation/AliceAnnotation.java src/main/java/alice/Annotation/AliceAnnotationTest.java src/main/java/alice/Annotation/CS.java src/main/java/alice/Annotation/Data.java src/main/java/alice/Annotation/InputData.java src/main/java/alice/Annotation/InputProcesser.java src/main/java/alice/Annotation/StringData.java |
diffstat | 7 files changed, 54 insertions(+), 84 deletions(-) [+] |
line wrap: on
line diff
--- 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)); } - }
--- 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"); } }
--- 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<InputData>(); - 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; - } -}
--- /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<T> { + Type getType(); + void setType(Type type); + T getData(); + void setData(T data); +}
--- 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<T> { - - private T value; - private String key; - - public InputData(T value){ - this.value = value; - } - - public T getValue() { - return value; - } - -}
--- 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<? extends TypeElement> typeElements, RoundEnvironment roundEnv) { - - /*for (TypeElement typeElement : typeElements) { - Set<? extends Element> 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
--- /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> { + + 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; + } +}