comparison graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/TypeCheck.java @ 14906:f3a5036cc13c

javadoc fixes javadoc has become stricter in jdk8
author Bernhard Urban <bernhard.urban@jku.at>
date Mon, 31 Mar 2014 20:51:09 +0200
parents 494b818b527c
children e6d15134ca86
comparison
equal deleted inserted replaced
14905:b7afc71535d3 14906:f3a5036cc13c
33 * defined in the parent {@link TypeSystem}. The annotated method must have exactly one argument 33 * defined in the parent {@link TypeSystem}. The annotated method must have exactly one argument
34 * where the type of the argument is the generic type {@link Object} or a more specific one from the 34 * where the type of the argument is the generic type {@link Object} or a more specific one from the
35 * {@link TypeSystem}. You can define multiple overloaded {@link TypeCheck} methods for the same 35 * {@link TypeSystem}. You can define multiple overloaded {@link TypeCheck} methods for the same
36 * type. This can be used to reduce the boxing overhead in type conversions. 36 * type. This can be used to reduce the boxing overhead in type conversions.
37 * </p> 37 * </p>
38 * 38 *
39 * <p> 39 * <p>
40 * By default the system generates type checks for all types in the parent {@link TypeSystem} which 40 * By default the system generates type checks for all types in the parent {@link TypeSystem} which
41 * look like the follows: 41 * look like the follows:
42 * 42 *
43 * <pre> 43 * <pre>
44 * {@literal @}TypeCheck 44 * {@literal @}TypeCheck
45 * boolean is${typeName}(Object value) { 45 * boolean is${typeName}(Object value) {
46 * return value instanceof ${typeName}; 46 * return value instanceof ${typeName};
47 * } 47 * }
48 * </pre> 48 * </pre>
49 * 49 *
50 * </p>
51 *
52 * <b>Example:</b> 50 * <b>Example:</b>
53 * <p> 51 * <p>
54 * A type check for BigInteger with one overloaded optimized variant to reduce boxing. 52 * A type check for BigInteger with one overloaded optimized variant to reduce boxing.
55 * </p> 53 * </p>
56 * 54 *
57 * <pre> 55 * <pre>
58 * 56 *
59 * 57 *
60 * {@literal @}TypeSystem(types = {int.class, BigInteger.class, String.class}, nodeBaseClass = TypedNode.class) 58 * {@literal @}TypeSystem(types = {int.class, BigInteger.class, String.class}, nodeBaseClass = TypedNode.class)
61 * public abstract class Types { 59 * public abstract class Types {
62 * 60 *
63 * {@literal @}TypeCheck 61 * {@literal @}TypeCheck
64 * public boolean isBigInteger(Object value) { 62 * public boolean isBigInteger(Object value) {
65 * return value instanceof Integer || value instanceof BigInteger; 63 * return value instanceof Integer || value instanceof BigInteger;
66 * } 64 * }
67 * 65 *
68 * {@literal @}TypeCheck 66 * {@literal @}TypeCheck
69 * public boolean isBigInteger(int value) { 67 * public boolean isBigInteger(int value) {
70 * return true; 68 * return true;
71 * } 69 * }
72 * 70 *
73 * } 71 * }
74 * </pre> 72 * </pre>
75 * 73 *
76 * 74 *
77 */ 75 */
78 @Retention(RetentionPolicy.CLASS) 76 @Retention(RetentionPolicy.CLASS)
79 @Target({ElementType.METHOD}) 77 @Target({ElementType.METHOD})
80 public @interface TypeCheck { 78 public @interface TypeCheck {
81 79