1 9 10 package org.nfunk.jepexamples; 11 12 19 public class ThreadTest { 20 21 static long time = 0; 22 23 26 public static void main(String [] args) { 27 ThreadTest test = new ThreadTest(); 28 29 for (int i = 0; i < 1000; i++) { 30 ThreadTestThread t = new ThreadTestThread(test); 31 t.start(); 32 } 33 } 34 35 public ThreadTest() { 36 } 37 38 42 public void evaluate() { 43 for (int i = 0; i < 10; i++) { 44 org.nfunk.jep.JEP myParser = new org.nfunk.jep.JEP(); 45 String fooValue = null; 46 Math.random(); 47 48 if (Math.random()> 0.5) { 49 fooValue="NLS"; 50 } else { 51 fooValue="NLT"; 52 } 53 54 myParser.addVariable("foo",fooValue); 55 myParser.parseExpression("foo==\""+fooValue + "\""); 56 57 if (myParser.getValue() < 1.0) 58 System.out.println("ERROR"); 59 } 60 } 61 } 62 | Popular Tags |