/** * Records the <code>$cflow</code> variable for the field specified * by <code>cname</code> and <code>fname</code>. * * @param name variable name * @param cname class name * @param fname field name */ void recordCflow(String name, String cname, String fname) { if (cflow == null) cflow = new Hashtable(); cflow.put(name, new Object[] { cname, fname }); }
private void addCDATAElement(String uri, String localName) { if (m_CdataElems == null) { m_CdataElems = new java.util.Hashtable(); } java.util.Hashtable h = (java.util.Hashtable) m_CdataElems.get(localName); if (h == null) { h = new java.util.Hashtable(); m_CdataElems.put(localName,h); } h.put(uri,uri); }
/** * Create a new JNDI initial context. Invoked by {@link #execute}. * <p>The default implementation use this template's environment settings. * Can be subclassed for custom contexts, e.g. for testing. * * @return the initial Context instance * @throws NamingException in case of initialization errors */ @SuppressWarnings({"unchecked"}) protected Context createInitialContext() throws NamingException { Properties env = getEnvironment(); Hashtable icEnv = null; if (env != null) { icEnv = new Hashtable(env.size()); for (Enumeration en = env.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); icEnv.put(key, env.getProperty(key)); } } return new InitialContext(icEnv); }
public Hashtable<Unit, Region> getUnit2RegionMap() { Hashtable<Unit, Region> unit2region = new Hashtable<Unit, Region>(); List<Region> regions = this.getRegions(); for (Iterator<Region> itr = regions.iterator(); itr.hasNext();) { Region r = itr.next(); List<Unit> units = r.getUnits(); for (Iterator<Unit> itr1 = units.iterator(); itr1.hasNext();) { Unit u = itr1.next(); unit2region.put(u, r); } } return unit2region; }
System.out.println("Purpose: authenticate user against Active Directory and list group membership."); System.out.println("Usage: App2 <username> <password> <domain> <server>"); System.out.println("Short usage: App2 <username> <password>"); System.out.println("(short usage assumes 'xyz.tld' as domain and 'abc' as server)"); System.exit(1); Hashtable props = new Hashtable(); String principalName = username + "@" + domainName; props.put(Context.SECURITY_PRINCIPAL, principalName); props.put(Context.SECURITY_CREDENTIALS, password); DirContext context; Iterator ig = groups.iterator(); while (ig.hasNext()) { System.out.println(" " + ig.next().toString());
Hashtable nodeindex = new Hashtable(graph.size()); Object node = nodesIt.next(); Object node = nodesIt.next(); String nodeName = null; if (node instanceof List) { Object s = succsIt.next(); System.out.println("Drew main chain"); System.out.println("while printing, startToThread has size " + graph.getStartToThread().size()); Set maps = graph.getStartToThread().entrySet(); System.out.println("maps has size " + maps.size()); for (Iterator iter = maps.iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next();
public void addAll(WeightedDirectedSparseGraph othergraph) { WeightedDirectedSparseGraph another = othergraph; this.isUnknown = another.isUnknown; this.clear(); Hashtable<Object, Hashtable<Object, IntContainer>> othersources = another.sources; Iterator<Object> othersrcIt = othersources.keySet().iterator(); while (othersrcIt.hasNext()) { Object src = othersrcIt.next(); Hashtable othertargets = othersources.get(src); Hashtable<Object, IntContainer> thistargets = new Hashtable<Object, IntContainer>(othersources.size()); this.sources.put(src, thistargets); Iterator targetIt = othertargets.keySet().iterator(); while (targetIt.hasNext()) { Object target = targetIt.next(); IntContainer otherweight = (IntContainer) othertargets.get(target); thistargets.put(target, otherweight.dup()); } } }
/** * A test method. * @param args not used */ public static void main(String[] args) { try { Hashtable<String, String> hash = new Hashtable<>(); hash.put("VERSION", "1.0.3"); hash.put("b", "ffff"); System.out.println(KeySubst.replace("$f ${VERSION} f ${b} jj $", hash)); } catch (Exception e) { e.printStackTrace(); //NOSONAR } }
Hashtable<Integer, String> evalText = new Hashtable<Integer, String>(260); for (int i = 0; i < readerQueries.maxDoc(); i++) { if (readerQueries.hasDeletions() && !liveDocs.get(i)) continue; // if it is deleted, just ignore it. evalText.put(query2id.get(fileName), tmpEval); fw.write(evalText.get(i + 1)); System.out.println(str);
b = bbuf.array(); } catch (CharacterCodingException e) { System.out.println(e.getMessage()); com.google.zxing.Writer writer = new MultiFormatWriter(); try { Hashtable<EncodeHintType, String> hints = new Hashtable<EncodeHintType, String>(2); hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); matrix = writer.encode(data, com.google.zxing.BarcodeFormat.QR_CODE, w, h, hints); } catch (com.google.zxing.WriterException e) { System.out.println(e.getMessage()); try { MatrixToImageWriter.writeToFile(matrix, "PNG", file); System.out.println("printing to " + file.getAbsolutePath()); } catch (IOException e) { System.out.println(e.getMessage());
/** * Cleans up any resources held by this classloader. Any open archive * files are closed. */ public synchronized void cleanup() { for (Enumeration e = jarFiles.elements(); e.hasMoreElements();) { JarFile jarFile = (JarFile) e.nextElement(); try { jarFile.close(); } catch (IOException ioe) { // ignore } } jarFiles = new Hashtable(); if (project != null) { project.removeBuildListener(this); } project = null; }
_namedTemplates = new Hashtable(); _neededTemplates = new Hashtable(); _templateIHs = new Hashtable(); _templateILs = new Hashtable(); _patternGroups = new Vector[32]; _rootPattern = null; _templates = new Vector(); final Enumeration templates = oldTemplates.elements(); while (templates.hasMoreElements()) { final Template template = (Template)templates.nextElement(); final int prec = template.getImportPrecedence(); if ((prec >= min) && (prec < max)) addTemplate(template);
DecodeThread(CaptureActivity activity, Vector<BarcodeFormat> decodeFormats, String characterSet, ResultPointCallback resultPointCallback) { this.activity = activity; handlerInitLatch = new CountDownLatch(1); hints = new Hashtable<DecodeHintType, Object>(3); if (decodeFormats == null || decodeFormats.isEmpty()) { decodeFormats = new Vector<BarcodeFormat>(); decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS); decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS); decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS); } hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats); if (characterSet != null) { hints.put(DecodeHintType.CHARACTER_SET, characterSet); } hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback); }
/** * This method starts at a given node, traverses all namespace mappings, * and assembles a list of all prefixes that (for the given node) maps * to _ANY_ namespace URI. Used by literal result elements to determine */ public Enumeration getNamespaceScope(SyntaxTreeNode node) { Hashtable all = new Hashtable(); while (node != null) { Hashtable mapping = node.getPrefixMapping(); if (mapping != null) { Enumeration prefixes = mapping.keys(); while (prefixes.hasMoreElements()) { String prefix = (String)prefixes.nextElement(); if (!all.containsKey(prefix)) { all.put(prefix, mapping.get(prefix)); } } } node = node.getParent(); } return(all.keys()); }
protected ActiveMQConnectionFactory createConnectionFactory(String name, Hashtable environment) throws URISyntaxException { Hashtable temp = new Hashtable(environment); if (DEFAULT_CONNECTION_FACTORY_NAMES[1].equals(name)) { // don't try to mod environment, it may be readonly temp.put("xa", String.valueOf(true)); } String prefix = connectionPrefix + name + "."; for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry)iter.next(); String key = (String)entry.getKey(); if (key.startsWith(prefix)) { // Rename the key... temp.remove(key); key = key.substring(prefix.length()); temp.put(key, entry.getValue()); } } return createConnectionFactory(temp); }
mb = connector.getMBeanServerConnection(); Hashtable<String, String> pairs = new Hashtable<>(); pairs.put("service", "HBase"); pairs.put("name", "Master"); pairs.put("sub", "Balancer"); target = new ObjectName("Hadoop", pairs); MBeanInfo beanInfo = mb.getMBeanInfo(target); Set<ObjectInstance> instances = mb.queryMBeans(null, null); Iterator<ObjectInstance> iterator = instances.iterator(); System.out.println("MBean Found:"); while (iterator.hasNext()) { ObjectInstance instance = iterator.next(); System.out.println("Class Name: " + instance.getClassName()); System.out.println("Object Name: " + instance.getObjectName());
public void addBoundedAll(WeightedDirectedSparseGraph another) { this.isUnknown = another.isUnknown; Hashtable<Object, Hashtable<Object, IntContainer>> othersources = another.sources; Iterator thisnodeIt = this.vertexes.iterator(); while (thisnodeIt.hasNext()) { Object src = thisnodeIt.next(); Hashtable othertargets = othersources.get(src); if (othertargets == null) { continue; } Hashtable<Object, IntContainer> thistargets = new Hashtable<Object, IntContainer>(); Iterator othertargetIt = othertargets.keySet().iterator(); while (othertargetIt.hasNext()) { Object key = othertargetIt.next(); if (this.vertexes.contains(key)) { IntContainer weight = (IntContainer) othertargets.get(key); thistargets.put(key, weight.dup()); } } if (thistargets.size() > 0) { this.sources.put(src, thistargets); } } }