public static Enumeration compoundEnumerations(Enumeration list1, Enumeration list2) { if (list2 == null || !list2.hasMoreElements()) return list1; if (list1 == null || !list1.hasMoreElements()) return list2; Vector compoundResults = new Vector(); while (list1.hasMoreElements()) compoundResults.add(list1.nextElement()); while (list2.hasMoreElements()) { Object item = list2.nextElement(); if (!compoundResults.contains(item)) // don't add duplicates compoundResults.add(item); } return compoundResults.elements(); }
/** @deprecated */ public Enumeration getConditionalPermissionInfos() { // could implement our own Enumeration, but we don't care about performance here. Just do // something simple: synchronized (lock) { SecurityRow[] rows = condAdminTable.getRows(); Vector vRows = new Vector(rows.length); for (int i = 0; i < rows.length; i++) vRows.add(rows[i]); return vRows.elements(); } }
/** * Registers the specified listener with this provider so that it would receive notifications on * changes of its state or other properties such as its local address and display name. * * @param listener the listener to register. */ public void addRegistrationStateChangeListener(RegistrationStateChangeListener listener) { synchronized (registrationStateListeners) { if (!registrationStateListeners.contains(listener)) registrationStateListeners.add(listener); } }