import java.lang.*;
import java.lang.reflect.*;
import java.util.*;
+import java.math.*;
public class ClassDemo {
TypeVariable[] tValue = List.class.getTypeParameters();
//System.out.println(tValue[0].getName());
System.out.println(tValue[0]);
+
+ BigInteger bi = new BigInteger("-1");
+ System.out.println(bi);
}
-}
\ No newline at end of file
+}
class Empty {
- public static void main(String... args) {
- /*int rand = Math.random()*10
- int test = 10;
- double test2 = 0.0;*/
+ // This function runs when the SmartApp is installed
+ def installed() {
+ // This is a standard debug statement in Groovy
+ //log.debug "Installed with settings: ${settings}"
+ int x = 5;
+ int y = 6;
+ int result = x + y;
+ return result;
+ //initialize()
+ }
+ // This function is where you initialize callbacks for event listeners
+ //def initialize() {
+ // The subscribe function takes a input, a state, and a callback method
+ //subscribe(contact, "contact.open", openHandler)
+ //subscribe(contact, "contact.closed", closedHandler)
+ //}
+
+ static void main(String[] args) {
+
+ //Empty emp = new Empty();
+ //int result = emp.installed();
+ println result;
+ //println "Test"
}
}
}
- class SampleClass {
+ class SampleClass<U> {
private String sampleField;
- public Generic<Integer,String,Double,Short> setSampleField(List<String> listString, Map<Integer,String> mapString,
+ public Generic<Integer,String,Double,Short> setSampleField(Class<U> clazz, List<String> listString, Map<Integer,String> mapString,
Generic<Integer,String,Double,Short> test,
String sampleField, int one, short two, double three, Object obj) {
this.sampleField = sampleField;
public static void main(String[] args) {
Method[] methods = SampleClass.class.getMethods();
- Type[] parameters = methods[0].getGenericParameterTypes();
+ Type[] parameters = methods[3].getGenericParameterTypes();
//Type[] parameters = methods[0].getGenericParameterTypes();
for (int i = 0; i < parameters.length; i++) {
System.out.println(parameters[i]);
// TODO: in the class file.
if (genericSignature == null || genericSignature.equals("") || genericSignature.contains("<*>"))
return getArgumentTypeNames();
- if (!genericSignature.contains(":"))
- return new String[0];
return Types.getArgumentTypeNames(genericSignature);
}
// TODO: in the class file.
if (genericSignature == null || genericSignature.equals("") || genericSignature.contains("<*>"))
return Types.getReturnTypeName(signature);
- if (!genericSignature.contains(":"))
- return Types.getReturnTypeName(signature);
return Types.getGenericReturnTypeName(genericSignature);
}