public Enumeration<ColumnGroup> getColumnGroups(TableColumn col) { if (columnGroups == null) { return null; } Enumeration<ColumnGroup> enum1 = columnGroups.elements(); while (enum1.hasMoreElements()) { ColumnGroup cGroup = (ColumnGroup) enum1.nextElement(); Vector<ColumnGroup> v_ret = cGroup.getColumnGroups(col, new Vector<ColumnGroup>()); if (v_ret != null) { return v_ret.elements(); } } return null; }
public void setColumnMargin(int margin) { this.margin = margin; Enumeration<Object> enumeration = vector.elements(); while (enumeration.hasMoreElements()) { Object obj = enumeration.nextElement(); if (obj instanceof ColumnGroup) { ((ColumnGroup) obj).setColumnMargin(margin); } } }
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ @Override public Enumeration<Option> listOptions() { Vector<Option> newVector = new Vector<Option>(); newVector.addElement(new Option("\tOutput additional statistics.", "additional-stats", 0, "-additional-stats")); newVector.addAll(Collections.list(super.listOptions())); return newVector.elements(); }
public void testSizeIsEmpty_Enumeration() { Vector list = new Vector(); assertEquals(true, CollectionUtils.sizeIsEmpty(list.elements())); list.add("a"); assertEquals(false, CollectionUtils.sizeIsEmpty(list.elements())); Enumeration en = list.elements(); en.nextElement(); assertEquals(true, CollectionUtils.sizeIsEmpty(en)); } public void testSizeIsEmpty_Iterator() {
/** * Constructs a new {@code SequenceInputStream} using the two streams * {@code s1} and {@code s2} as the sequence of streams to read from. * * @param s1 * the first stream to get bytes from. * @param s2 * the second stream to get bytes from. * @throws NullPointerException * if {@code s1} is {@code null}. */ public SequenceInputStream(InputStream s1, InputStream s2) { if (s1 == null) { throw new NullPointerException("s1 == null"); } Vector<InputStream> inVector = new Vector<InputStream>(1); inVector.addElement(s2); e = inVector.elements(); in = s1; }
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(); }
/** * Returns the classpath this classloader will consult. * * @return the classpath used for this classloader, with elements * separated by the path separator for the system. */ public String getClasspath() { StringBuffer sb = new StringBuffer(); boolean firstPass = true; Enumeration componentEnum = pathComponents.elements(); while (componentEnum.hasMoreElements()) { if (!firstPass) { sb.append(System.getProperty("path.separator")); } else { firstPass = false; } sb.append(((File) componentEnum.nextElement()).getAbsolutePath()); } return sb.toString(); }
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ @Override public Enumeration<Option> listOptions() { Vector<Option> result = new Vector<Option>(); result.addElement(new Option("\tThe class index\n" + "\t(default: last)", "c", 1, "-c <class index>")); result.addAll(Collections.list(super.listOptions())); return result.elements(); }
/** * Returns all of the persistent data from the previously specified persistence directory. * @return all of the persistent data from the persistence directory. * @throws MqttPersistenceException if an exception is thrown whilst getting the keys */ public Enumeration keys() throws MqttPersistenceException { checkIsOpen(); File[] files = getFiles(); Vector result = new Vector(files.length); for (int i=0;i<files.length;i++) { String filename = files[i].getName(); String key = filename.substring(0,filename.length()-MESSAGE_FILE_EXTENSION.length()); result.addElement(key); } return result.elements(); }
public SortedKeyEnumeration(Hashtable ht) { Enumeration f = ht.keys(); Vector keys = new Vector(ht.size()); for (int i, last = 0; f.hasMoreElements(); ++last) { String key = (String) f.nextElement(); for (i = 0; i < last; ++i) { String s = (String) keys.get(i); if (key.compareTo(s) <= 0) break; } keys.add(i, key); } e = keys.elements(); }
for (Enumeration e = systemPackages.elements(); e.hasMoreElements();) { String packageName = (String) e.nextElement(); if (resourceName.startsWith(packageName)) { useParentFirst = true; for (Enumeration e = loaderPackages.elements(); e.hasMoreElements();) { String packageName = (String) e.nextElement(); if (resourceName.startsWith(packageName)) { useParentFirst = false;
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ @Override public Enumeration<Option> listOptions() { Vector<Option> result = new Vector<Option>(); result.addElement(new Option("The class index", "c", 1, "-c <the class index>")); result.addAll(Collections.list(super.listOptions())); return result.elements(); }
/** 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(); }
/** * make sure we close all network connections when this handler is destroyed. * @since 1.2.15 */ public void close() { synchronized(this) { for(Enumeration e = connections.elements();e.hasMoreElements();) { try { ((Socket)e.nextElement()).close(); } catch(InterruptedIOException ex) { Thread.currentThread().interrupt(); } catch(IOException ex) { } catch(RuntimeException ex) { } } } try { serverSocket.close(); } catch(InterruptedIOException ex) { Thread.currentThread().interrupt(); } catch(IOException ex) { } catch(RuntimeException ex) { } }
/** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ @Override public Enumeration<Option> listOptions() { Vector<Option> newVector = new Vector<Option>(); newVector.addElement(new Option("\tSet base of the expansion constant\n" + "\t(default = 1.3).", "B", 1, "-B <value>")); newVector.addAll(Collections.list(super.listOptions())); return newVector.elements(); }