/** * Test if the search is still the current one. * @param curquery The current search text. */ protected synchronized boolean isCurrentQuery(String curquery) { return SUtil.equals(this.curquery, curquery); }
/** * Set the required services. * @param required services The required services to set. */ public void setRequiredServices(RequiredServiceInfo[] requiredservices) { this.requiredservices = SUtil.arrayToList(requiredservices); }
/** * Create a string representation. */ public String toString() { synchronized(monitor) { return SUtil.arrayToString(elements); } } }
/** * Build the digest given the timestamp and password. */ public static byte[] buildDigest(long timestamp, String secret) { // System.out.println("build digest: "+timestamp+" "+secret); byte[] input = (byte[])SUtil.joinArrays(secret.getBytes(), SUtil.longToBytes(timestamp)); return buildDigest(input); }
public Object[] toArray() { return equality!=null && identity!=null ? (Object[]) SUtil.joinArrays(equality.toArray(), identity.toArray()) : equality!=null ? equality.toArray() : identity!=null ? identity.toArray() : new Object[0]; }
/** * Create a globally unique conversation id. * @return The conversation id. * @deprecated Use SUtil.createUniqueId() instead */ public static String createUniqueId(String name) { return SUtil.createUniqueId(name); } }
public boolean isDataFlavorSupported(DataFlavor flavor) { return SUtil.arrayToSet(flavors).contains(flavor); } }
/** * Load a model. * @param name The original name (i.e. not filename). * @param info The resource info. */ protected ICacheableModel doLoadModel(String name, String[] imports, ResourceInfo info, ClassLoader classloader, Object context) throws Exception { if (name != null && name.endsWith(".bpmn2")) { MBpmnModel model = SBpmnModelReader.readModel(new File(info.getFilename()), null, classloader); IResourceIdentifier rid = (IResourceIdentifier)((Object[])context)[0]; if(rid==null) { String src = SUtil.getCodeSource(info.getFilename(), ((ModelInfo)model.getModelInfo()).getPackage()); URL url = SUtil.toURL(src); rid = new ResourceIdentifier(new LocalResourceIdentifier((IComponentIdentifier)((Object[])context)[1], url), null); } model.setResourceIdentifier(rid); model.initModelInfo(); return model; } return (ICacheableModel)BpmnXMLReader.read(info, classloader, (IResourceIdentifier)((Object[])context)[0], (IComponentIdentifier)((Object[])context)[1]); } }
/** * Convert a file/string/url array. * @param urls The url strings. * @return The urls. */ public static URL[] toURLs(Object[] urls) { if(urls==null) return null; List<URL> res = new ArrayList<URL>(); for(int i=0; i<urls.length; i++) { try { res.add(toURL(urls[i])); } catch(Exception e) { System.out.println("Warning, invalid URL found: "+urls[i]); } } return res.toArray(new URL[res.size()]); }
public Object[] toArray() { return equality!=null && identity!=null ? (Object[]) SUtil.joinArrays(equality.toArray(), identity.toArray()) : equality!=null ? equality.toArray() : identity!=null ? identity.toArray() : new Object[0]; }
/** * Create a globally unique conversation id. * @return The conversation id. * @deprecated Use SUtil.createUniqueId() instead */ public static String createUniqueId(String name) { return SUtil.createUniqueId(name); } }
/** * Build the digest given the timestamp and password. */ public static byte[] buildDigest(long timestamp, String secret) { // System.out.println("build digest: "+timestamp+" "+secret); byte[] input = (byte[])SUtil.joinArrays(secret.getBytes(), SUtil.longToBytes(timestamp)); return buildDigest(input); }
public boolean isDataFlavorSupported(DataFlavor flavor) { return SUtil.arrayToSet(flavors).contains(flavor); } }
/** * */ public ClassLoader getClassLoader() { if(classloader==null) { List<URL> urls = new ArrayList<URL>(); for(int i=0; i<model.getRowCount(); i++) { urls.add(SUtil.toURL(model.getValueAt(i, 0))); } classloader = new URLClassLoader(urls.toArray(new URL[urls.size()]), null); } return classloader; }
/** * Test if two objects are equal. */ public boolean equals(Object obj) { return obj instanceof ProcessThreadInfo && SUtil.equals(((ProcessThreadInfo)obj).id, id); }
/** * Convert this tuple to a string representation. * @return A string representation of this tuple. */ public String toString() { return "Tuple"+SUtil.arrayToString(entities); }
/** * Set the imports. * @param imports The imports to set. */ public void setImports(String[] imports) { if(imports!=null) this.imports = SUtil.arrayToList(imports); else this.imports = null; }
public Object[] getPath() { return (Object[]) SUtil.joinArrays(((AbstractInspectorNode)super.parent).getPath(), new Object[]{this}); }
/** * Create a new cron job. */ public CronJob(String pattern, IFilter<Long> filter, IResultCommand<IFuture<T>, Tuple2<IInternalAccess, Long>> command) { this.id = SUtil.createUniqueId("cronjob"); this.pattern = pattern; this.filter = filter; this.command = command; }
/** * Build the digest given the timestamp and password. */ public static byte[] buildDigest(long timestamp, String secret) { // System.out.println("build digest: "+timestamp+" "+secret); try { MessageDigest md = MessageDigest.getInstance("SHA-384"); byte[] input = (byte[])SUtil.joinArrays(secret.getBytes(), SUtil.longToBytes(timestamp)); byte[] output = md.digest(input); return output; } catch(NoSuchAlgorithmException e) { // Shouldn't happen? throw new RuntimeException(e); } }