Files
CraftTweaker/buildSrc/src/main/java/stanhebben/zenscript/docs/ZenOperatorDoc.java
T

70 lines
2.4 KiB
Java
Raw Normal View History

2014-06-12 21:37:56 +02:00
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package stanhebben.zenscript.docs;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Type;
import java.util.HashMap;
import java.util.Map;
import static stanhebben.zenscript.docs.ZenOperatorDocType.*;
2014-06-12 21:37:56 +02:00
/**
*
* @author Stan
*/
public class ZenOperatorDoc {
private static Map<String, ZenOperatorDocType> TYPES;
static {
TYPES = new HashMap<String, ZenOperatorDocType>();
TYPES.put("stanhebben.zenscript.annotations.OperatorType.ADD", ADD);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.SUB", SUB);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.MUL", MUL);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.DIV", DIV);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.MOD", MOD);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.CAT", CAT);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.OR", OR);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.AND", AND);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.XOR", XOR);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.NEG", NEG);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.NOT", NOT);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.INDEXSET", INDEXSET);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.INDEXGET", INDEXGET);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.RANGE", RANGE);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.CONTAINS", CONTAINS);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.COMPARE", COMPARE);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.MEMBERGETTER", MEMBERGETTER);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.MEMBERSETTER", MEMBERSETTER);
TYPES.put("stanhebben.zenscript.annotations.OperatorType.EQUALS", EQUALS);
}
2014-06-12 21:37:56 +02:00
private final String operator;
private final MethodDoc method;
private final Type[] types;
2014-06-12 21:37:56 +02:00
public ZenOperatorDoc(String operator, MethodDoc method, Type[] types) {
2014-06-12 21:37:56 +02:00
this.operator = operator;
this.method = method;
this.types = types;
2014-06-12 21:37:56 +02:00
}
public String getOperator() {
return operator;
}
public Type[] getTypes() {
return types;
}
public ZenOperatorDocType getOperatorType() {
return TYPES.get(operator);
}
2014-06-12 21:37:56 +02:00
public MethodDoc getMethod() {
return method;
}
}