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;
|
2014-07-09 22:50:15 +02:00
|
|
|
import com.sun.javadoc.Type;
|
2014-07-09 12:29:46 +02:00
|
|
|
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 {
|
2014-07-09 12:29:46 +02:00
|
|
|
private static Map<String, ZenOperatorDocType> TYPES;
|
|
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
TYPES = new HashMap<String, ZenOperatorDocType>();
|
2014-07-09 22:50:15 +02:00
|
|
|
TYPES.put("stanhebben.zenscript.annotations.OperatorType.ADD", ADD);
|
|
|
|
|
TYPES.put("stanhebben.zenscript.annotations.OperatorType.SUB", SUB);
|
2014-07-09 12:29:46 +02:00
|
|
|
TYPES.put("stanhebben.zenscript.annotations.OperatorType.MUL", MUL);
|
2014-07-09 22:50:15 +02:00
|
|
|
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-07-09 12:29:46 +02:00
|
|
|
}
|
|
|
|
|
|
2014-06-12 21:37:56 +02:00
|
|
|
private final String operator;
|
|
|
|
|
private final MethodDoc method;
|
2014-07-09 22:50:15 +02:00
|
|
|
private final Type[] types;
|
2014-06-12 21:37:56 +02:00
|
|
|
|
2014-07-09 22:50:15 +02:00
|
|
|
public ZenOperatorDoc(String operator, MethodDoc method, Type[] types) {
|
2014-06-12 21:37:56 +02:00
|
|
|
this.operator = operator;
|
|
|
|
|
this.method = method;
|
2014-07-09 22:50:15 +02:00
|
|
|
this.types = types;
|
2014-06-12 21:37:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getOperator() {
|
|
|
|
|
return operator;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-09 22:50:15 +02:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|