Refine search
return new SimpleNamingContext(this.root, this.boundObjects, this.environment); Object found = this.boundObjects.get(name); if (found == null) { if (!name.endsWith("/")) { name = name + "/"; for (String boundName : this.boundObjects.keySet()) { if (boundName.startsWith(name)) { return new SimpleNamingContext(name, this.boundObjects, this.environment); StringUtils.collectionToDelimitedString(this.boundObjects.keySet(), ",") + "]");
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()); } } }
/** * Add all available classes, that depend on Remote, Home, Bean, PK * @param checkEntries files, that are extracted from the deployment descriptor * @throws BuildException if there is a problem. */ protected void checkAndAddDependants(Hashtable<String, File> checkEntries) throws BuildException { if (dependencyAnalyzer == null) { return; } dependencyAnalyzer.reset(); for (String entryName : checkEntries.keySet()) { if (entryName.endsWith(".class")) { String className = entryName.substring(0, entryName.length() - ".class".length()); className = className.replace(File.separatorChar, '/'); className = className.replace('/', '.'); dependencyAnalyzer.addRootClass(className); } } for (String classname : Collections.list(dependencyAnalyzer.getClassDependencies())) { String location = classname.replace('.', File.separatorChar) + ".class"; File classFile = new File(config.srcDir, location); if (classFile.exists()) { checkEntries.put(location, classFile); log("dependent class: " + classname + " - " + classFile, Project.MSG_VERBOSE); } } }
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); } } }
public String toString() { String graphstring = "WeightedDirectedSparseGraph:\n"; graphstring = graphstring + this.vertexes + "\n"; Iterator<Object> srcIt = sources.keySet().iterator(); while (srcIt.hasNext()) { Object src = srcIt.next(); graphstring = graphstring + src + " : "; Hashtable targets = sources.get(src); Iterator targetIt = targets.keySet().iterator(); while (targetIt.hasNext()) { Object target = targetIt.next(); IntContainer weight = (IntContainer) targets.get(target); graphstring = graphstring + target + "(" + weight.value + ") "; } graphstring += "\n"; } return graphstring; }
Completion.Builder b = new Completion.Builder(keyValue[0]); for (ObjectName name : completions) { for (String key : name.getKeyPropertyList().keySet()) { if (!keyValues.containsKey(key) && key.startsWith(keyValue[0])) { b.add(key.substring(keyValue[0].length()) + "=", false); Hashtable<String, String> a = completion.getKeyPropertyList(); a.remove(keyValue[0]); a.keySet().removeAll(keyValues.keySet()); if (a.isEmpty()) { b.add(value.substring(keyValue[1].length()), true); keyValues.put(keyValue[0], keyValue[1]); prev = next + 1;
files.put( filename, properties ); locales = new Hashtable<String, Boolean>( 10 ); for ( String filename : files.keySet() ) { String path = getPath( filename ); Integer num = directories.get( path ); if ( num != null ) { num = Integer.valueOf( num.intValue() + 1 ); num = Integer.valueOf( 1 ); directories.put( path, num ); locales.put( locale, Boolean.TRUE );
public void updateWeight(Object which, int c) { /* for the in edge, the weight + c. for the out edge, the weight - c */ Iterator<Object> srcIt = sources.keySet().iterator(); while (srcIt.hasNext()) { Object from = srcIt.next(); Hashtable targets = sources.get(from); IntContainer weight = (IntContainer) targets.get(which); if (weight != null) { weight.value += c; } } /* update out edges */ Hashtable toset = sources.get(which); if (toset == null) { return; } Iterator toIt = toset.keySet().iterator(); while (toIt.hasNext()) { Object to = toIt.next(); IntContainer weight = (IntContainer) toset.get(to); weight.value -= c; } }
private boolean SSSPFinder(Object src) { Hashtable<Object, IntContainer> outedges = sources.get(src); if (outedges == null) { return true; WeightedDirectedEdge edge = edgeIt.next(); IntContainer dfrom = distance.get(edge.from); IntContainer dto = distance.get(edge.to); if (dto == null) { continue; Iterator<Object> targetIt = distance.keySet().iterator(); while (targetIt.hasNext()) { Object to = targetIt.next(); IntContainer dist = distance.get(to); outedges.put(to, dist.dup());
private void getReachableNodesAndEdges(Object src) { LinkedList<Object> worklist = new LinkedList<Object>(); reachableNodes.add(src); worklist.add(src); while (!worklist.isEmpty()) { Object from = worklist.removeFirst(); Hashtable targets = sources.get(from); if (targets == null) { continue; } Iterator targetIt = targets.keySet().iterator(); while (targetIt.hasNext()) { Object target = targetIt.next(); if (!reachableNodes.contains(target)) { worklist.add(target); reachableNodes.add(target); } IntContainer weight = (IntContainer) targets.get(target); reachableEdges.add(new WeightedDirectedEdge(from, target, weight.value)); } } }
addressTable.put(a, Message.RecipientType.TO); addressTable.put(a, Message.RecipientType.TO); addressTable.put(a, Message.RecipientType.CC); m.setRecipients(Message.RecipientType.BCC, new Address[0]); Iterator<Address> aIter = addressTable.keySet().iterator(); m.addRecipient(addressTable.get(a), a); m.setRecipient(Message.RecipientType.TO, addressTable.keySet().iterator().next());
public void killNode(Object tokill) { if (!this.vertexes.contains(tokill)) { return; } this.makeShortestPathGraph(); List<Object> sourceList = new ArrayList<Object>(sources.keySet()); Iterator<Object> srcIt = sourceList.iterator(); while (srcIt.hasNext()) { Object src = srcIt.next(); Hashtable targets = sources.get(src); /* delete the in edge */ targets.remove(tokill); if (targets.size() == 0) { sources.remove(src); } } sources.remove(tokill); this.makeShortestPathGraph(); }
ArrayList<String> test = new ArrayList<String>(); Hashtable <ArrayList<String>, Integer> h1 = new Hashtable <ArrayList<String>, Integer>(); Hashtable <ArrayList<String>, Integer> h2 = new Hashtable <ArrayList<String>, Integer>(); for (ArrayList<String> key : h2.keySet()) { if(h1.containsKey(key)) h2.put(key, 1); }
for ( String filename : files.keySet() ) { if ( getPath( filename ).equals( dir ) ) { // yep, add this one Properties properties = files.get( filename ); ArrayList<Object> entryObjects = new ArrayList<Object>( properties.keySet() ); ArrayList<String> entries = new ArrayList<String>(); } else { String javaFile = dir + "/" + classname + ".java"; fileContent = javaFiles.get( javaFile ); if ( fileContent == null ) { fileContent = loadJava( javaFile, filename, entry ); javaFiles.put( javaFile, fileContent ); boolean localeSelected = ( locales.get( locale ) ).booleanValue();
List<Object> sourceList = new ArrayList<Object>(this.sources.keySet()); Hashtable thistargets = this.sources.get(src); Hashtable othertargets = othersources.get(src); List targetList = new ArrayList(thistargets.keySet()); IntContainer thisweight = (IntContainer) thistargets.get(target); IntContainer otherweight = (IntContainer) othertargets.get(target);
@Override public List<UserVmJoinVO> newUserVmView(UserVm... userVms) { Hashtable<Long, UserVm> userVmDataHash = new Hashtable<Long, UserVm>(); for (UserVm vm : userVms) { if (!userVmDataHash.containsKey(vm.getId())) { userVmDataHash.put(vm.getId(), vm); } } Set<Long> vmIdSet = userVmDataHash.keySet(); List<UserVmJoinVO> uvms = searchByIds(vmIdSet.toArray(new Long[vmIdSet.size()])); // populate transit password field from UserVm if (uvms != null) { for (UserVmJoinVO uvm : uvms) { UserVm v = userVmDataHash.get(uvm.getId()); uvm.setPassword(v.getPassword()); } } return uvms; }
Iterator<Object> sourceIt = this.sources.keySet().iterator(); while (sourceIt.hasNext()) { Object src = sourceIt.next(); Hashtable thistarget = sources.get(src); Hashtable othertarget = othersources.get(src); Iterator targetIt = thistarget.keySet().iterator(); while (targetIt.hasNext()) { Object target = targetIt.next(); IntContainer thisweight = (IntContainer) thistarget.get(target); IntContainer otherweight = (IntContainer) othertarget.get(target);