public Enumeration getCurrentLoggers() { Vector<Logger> loggers = new Vector<Logger>(ht.size()); Enumeration elems = ht.elements(); while (elems.hasMoreElements()) { Object o = elems.nextElement(); if (o instanceof Logger) { Logger logger = (Logger)o; loggers.addElement(logger); } } return loggers.elements(); }
/** * This method is periodically invoked so that memory * footprint will be minimized. */ void compress() { if (compressCount++ > COMPRESS_THRESHOLD) { compressCount = 0; Enumeration e = classes.elements(); while (e.hasMoreElements()) ((CtClass)e.nextElement()).compress(); } }
public void testToListWithHashtable() { Hashtable expected = new Hashtable(); expected.put("one", new Integer(1)); expected.put("two", new Integer(2)); expected.put("three", new Integer(3)); // validate elements. List actualEltList = EnumerationUtils.toList(expected.elements()); Assert.assertEquals(expected.size(), actualEltList.size()); Assert.assertTrue(actualEltList.contains(new Integer(1))); Assert.assertTrue(actualEltList.contains(new Integer(2))); Assert.assertTrue(actualEltList.contains(new Integer(3))); List expectedEltList = new ArrayList(); expectedEltList.add(new Integer(1)); expectedEltList.add(new Integer(2)); expectedEltList.add(new Integer(3)); Assert.assertTrue(actualEltList.containsAll(expectedEltList)); // validate keys. List actualKeyList = EnumerationUtils.toList(expected.keys()); Assert.assertEquals(expected.size(), actualEltList.size()); Assert.assertTrue(actualKeyList.contains("one")); Assert.assertTrue(actualKeyList.contains("two")); Assert.assertTrue(actualKeyList.contains("three")); List expectedKeyList = new ArrayList(); expectedKeyList.add("one"); expectedKeyList.add("two"); expectedKeyList.add("three"); Assert.assertTrue(actualKeyList.containsAll(expectedKeyList)); }
public BundleInfo[] getAllBundles() { Enumeration b = bundles.elements(); BundleInfo[] binfo = new BundleInfo[bundles.size()]; for (int i = 0; i < binfo.length; i++) { binfo[i] = (BundleInfo) b.nextElement(); } return binfo; }
/** Returns all the currently defined categories in this hierarchy as an {@link java.util.Enumeration Enumeration}. <p>The root logger is <em>not</em> included in the returned {@link Enumeration}. */ public Enumeration getCurrentLoggers() { // The accumlation in v is necessary because not all elements in // ht are Logger objects as there might be some ProvisionNodes // as well. Vector v = new Vector(ht.size()); Enumeration elems = ht.elements(); while(elems.hasMoreElements()) { Object o = elems.nextElement(); if(o instanceof Logger) { v.addElement(o); } } return v.elements(); }
/** * 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; }
public ServiceInfo[] getAllServiceInfo() { Enumeration s = services.elements(); ServiceInfo[] sinfo = new ServiceInfo[services.size()]; for (int i = 0; i < sinfo.length; i++) { sinfo[i] = (ServiceInfo) s.nextElement(); } return sinfo; }
public Enumeration getCurrentLoggers() { Vector<Logger> loggers = new Vector<Logger>(ht.size()); Enumeration elems = ht.elements(); while (elems.hasMoreElements()) { Object o = elems.nextElement(); if (o instanceof Logger) { Logger logger = (Logger)o; loggers.addElement(logger); } } return loggers.elements(); }
/** * Get required elements that were not found. * * @return required elements that were not found. */ String getRequiredElem() { if (m_requiredFound == null) return null; Enumeration elems = m_requiredFound.elements(); String s = ""; boolean first = true; while (elems.hasMoreElements()) { if (first) first = false; else s = s + ", "; s = s + (String)elems.nextElement(); } return s; }
public PackageInfo[] getAllPackageInfo() { Enumeration p = packages.elements(); PackageInfo[] pinfo = new PackageInfo[packages.size()]; for (int i = 0; i < pinfo.length; i++) { pinfo[i] = (PackageInfo) p.nextElement(); } return pinfo; }
/** Returns all the currently defined categories in this hierarchy as an {@link java.util.Enumeration Enumeration}. <p>The root logger is <em>not</em> included in the returned {@link Enumeration}. */ public Enumeration getCurrentLoggers() { // The accumlation in v is necessary because not all elements in // ht are Logger objects as there might be some ProvisionNodes // as well. Vector v = new Vector(ht.size()); Enumeration elems = ht.elements(); while(elems.hasMoreElements()) { Object o = elems.nextElement(); if(o instanceof Logger) { v.addElement(o); } } return v.elements(); }
/** * This method is periodically invoked so that memory * footprint will be minimized. */ void compress() { if (compressCount++ > COMPRESS_THRESHOLD) { compressCount = 0; Enumeration e = classes.elements(); while (e.hasMoreElements()) ((CtClass)e.nextElement()).compress(); } }
public String getValue() { if(this.properties.size() == 1) { String key = (String)this.properties.keys().nextElement(); if(key.trim().length()==0 || this.calculatePropertyUri(this.listProperty).endsWith(key.trim())) { return (String)this.properties.elements().nextElement(); } } return null; }
/** Returns all the currently defined categories in this hierarchy as an {@link java.util.Enumeration Enumeration}. <p>The root logger is <em>not</em> included in the returned {@link Enumeration}. */ public Enumeration getCurrentLoggers() { // The accumlation in v is necessary because not all elements in // ht are Logger objects as there might be some ProvisionNodes // as well. Vector v = new Vector(ht.size()); Enumeration elems = ht.elements(); while(elems.hasMoreElements()) { Object o = elems.nextElement(); if(o instanceof Logger) { v.addElement(o); } } return v.elements(); }
/** * This method is periodically invoked so that memory * footprint will be minimized. */ void compress() { if (compressCount++ > COMPRESS_THRESHOLD) { compressCount = 0; Enumeration e = classes.elements(); while (e.hasMoreElements()) ((CtClass)e.nextElement()).compress(); } }
/** * Method used for debug and monitoring. It returns an enumeration * of all agents loaded in memory. */ AgentId[] getLoadedAgentIdlist() { AgentId list[] = new AgentId[agents.size()]; int i = 0; for (Enumeration<Agent> e = agents.elements(); e.hasMoreElements() ;) list[i++] = e.nextElement().id; return list; }
/** * This method is periodically invoked so that memory * footprint will be minimized. */ void compress() { if (compressCount++ > COMPRESS_THRESHOLD) { compressCount = 0; Enumeration e = classes.elements(); while (e.hasMoreElements()) ((CtClass)e.nextElement()).compress(); } }
public NakedObjectSpecification[] allSpecifications() { final int size = specs.size(); final NakedObjectSpecification[] cls = new NakedObjectSpecification[size]; final Enumeration e = specs.elements(); int i = 0; while (e.hasMoreElements()) { cls[i++] = (NakedObjectSpecification) e.nextElement(); } return cls; } }
/** * Get required elements that were not found. * * @return required elements that were not found. */ String getRequiredElem() { if (m_requiredFound == null) return null; Enumeration elems = m_requiredFound.elements(); String s = ""; boolean first = true; while (elems.hasMoreElements()) { if (first) first = false; else s = s + ", "; s = s + (String)elems.nextElement(); } return s; }
public Action[] getBoundActions() { Action[] actions = new Action[bindings.size()]; int i = 0; for (Enumeration<Action> e = bindings.elements(); e.hasMoreElements();) { actions[i++] = e.nextElement(); } return actions; }