/** * Adds a new evaluator. * * @param evaluator The new evaluator. * @param weight The weight of the evaluator relative to other evaluators. */ public void addEvaluator(IServiceEvaluator evaluator, double weight) { evaluators.add(new Tuple2<IServiceEvaluator, Double>(evaluator, weight)); }
/** * */ protected JComponent getPluginComponent(IControlCenterPlugin pl) { JComponent ret = null; for(Tuple2<IControlCenterPlugin, JComponent> tup: plugins) { if(tup.getFirstEntity().equals(pl)) { ret = tup.getSecondEntity(); break; } } return ret; }
/** * Clone this tuple. * @return A shallow copy of this tuple. */ public Object clone() { return new Tuple2<T, E>(getFirstEntity(), getSecondEntity()); } }
public void customResultAvailable(Tuple2<String, String> result) { tests.add(new Tuple2<String, IResourceIdentifier>(result.getFirstEntity(), rid)); teststable.addEntry(result.getFirstEntity()); } });
/** * */ protected boolean isStop() { return stopflag.getFirstEntity().booleanValue(); }
public int compare(Tuple2<IBuyBookService, Integer> o1, Tuple2<IBuyBookService, Integer> o2) { return o1.getSecondEntity().compareTo(o2.getSecondEntity()); } });
public void run() { // System.out.println("finished2: "+result); if(testcases.containsKey(name)) { for(int i=0; i<names.length; i++) { if(name.equals(names[i])) { results[i] = result; } } testcases.remove(name); startNextTestcases(); updateProgress(); updateDetails(); } } });
public void customResultAvailable(Tuple2<Boolean, Object> result) { if(invert) { Boolean b = result.getFirstEntity().booleanValue()? Boolean.FALSE: Boolean.TRUE; result = new Tuple2<Boolean, Object>(b, result.getSecondEntity()); } super.customResultAvailable(result); } });
/** * */ protected boolean isStop() { return stopflag.getFirstEntity().booleanValue(); }
public int compare(Tuple2<IBuyBookService, Integer> o1, Tuple2<IBuyBookService, Integer> o2) { return o1.getSecondEntity().compareTo(o2.getSecondEntity()); } });
public void customResultAvailable(Tuple2<String, String> result) { tests.add(new Tuple2<String, IResourceIdentifier>(result.getFirstEntity(), rid)); teststable.addEntry(result.getFirstEntity()); } });
public void run() { // System.out.println("finished2: "+result); if(testcases.containsKey(name)) { for(int i=0; i<names.length; i++) { if(name.equals(names[i])) { results[i] = result; } } testcases.remove(name); startNextTestcases(); updateProgress(); updateDetails(); } } });
/** * */ protected JComponent getPluginComponent(IControlCenterPlugin pl) { JComponent ret = null; for(Tuple2<IControlCenterPlugin, JComponent> tup: plugins) { if(tup.getFirstEntity().equals(pl)) { ret = tup.getSecondEntity(); break; } } return ret; }
/** * Tests if a handler for the exact URI is currently published. * * @param vhost Virtual host specification. * @param path Path being handled. * @return True, if a handler was found. */ public boolean containsSubhandlerForExactUri(String vhost, String path) { return subhandlers.containsKey(new Tuple2<String, String>(vhost, path)); }
/** * Get the digest. */ public byte[] getDigest(long timestamp, String secret) { byte[] ret; // Get the digest that belongs to the secret Tuple2<Long, byte[]> tst = digests.get(secret); Long ts = Long.valueOf(timestamp); // Check if the timestamp of the digest is still ok if(tst!=null && tst.getFirstEntity().equals(ts)) { // System.out.println("reuse: "+timestamp+" "+secret); ret = tst.getSecondEntity(); } else { ret = buildDigest(timestamp, secret); digests.put(secret, new Tuple2<Long, byte[]>(ts, ret)); } return ret; }
/** * */ protected boolean isStop() { return stopflag.getFirstEntity().booleanValue(); }
public IFuture<Void> execute(IInternalAccess ia) { for(Iterator<IComponentIdentifier> it=conversations.keySet().iterator(); it.hasNext(); ) { Tuple2<ElizaParse, Long> tup = conversations.get(it.next()); if(tup.getSecondEntity().longValue()+30000<System.currentTimeMillis()) { it.remove(); } } return IFuture.DONE; } });
/** * Convert arguments to argument map. */ public static Map<String, Object> convertArguments(Collection<Tuple2<String, Object>> results) { Map<String, Object> ret = new HashMap<String, Object>(); for(Iterator<Tuple2<String, Object>> it=results.iterator(); it.hasNext(); ) { Tuple2<String, Object> tup = it.next(); ret.put(tup.getFirstEntity(), tup.getSecondEntity()); } return ret; } }
/** * Adds a new evaluator. * * @param evaluator The new evaluator. * @param weight The weight of the evaluator relative to other evaluators. */ public void addEvaluator(IServiceEvaluator evaluator, double weight) { evaluators.add(new Tuple2<IServiceEvaluator, Double>(evaluator, weight)); }
/** * Get the digest. */ public byte[] getDigest(long timestamp, String secret) { byte[] ret; Tuple2<Long, byte[]> tst = digests.get(secret); Long ts = new Long(timestamp); if(tst!=null && tst.getFirstEntity().equals(ts)) { // System.out.println("reuse: "+timestamp+" "+secret); ret = tst.getSecondEntity(); } else { ret = buildDigest(timestamp, secret); digests.put(secret, new Tuple2<Long, byte[]>(ts, ret)); } return ret; }