Example usage for java.util Vector elements

List of usage examples for java.util Vector elements

Introduction

In this page you can find the example usage for java.util Vector elements.

Prototype

public Enumeration<E> elements() 

Source Link

Document

Returns an enumeration of the components of this vector.

Usage

From source file:org.agnitas.beans.impl.MailingImpl.java

@Override
public void cleanupTrackableLinks(Vector<String> keep) {
    Vector<String> remove = new Vector<String>();
    String tmp = null;//from w ww  . j a  v  a 2 s.  c  o  m

    // first find keys which should be removed
    Iterator<String> it = this.trackableLinks.keySet().iterator();
    while (it.hasNext()) {
        tmp = it.next();
        if (!keep.contains(tmp)) {
            remove.add(tmp);
        }
    }
    // now remove them!
    Enumeration<String> e = remove.elements();
    while (e.hasMoreElements()) {
        this.trackableLinks.remove(e.nextElement());
    }
}

From source file:org.accada.reader.rprm.core.ReaderDevice.java

/**
 * Removes the specified Triggers from the list of Triggers currently
 * associated with the reader. If one or more of the Triggers given are not
 * known, or if some of the Triggers to be removed are currently not
 * associated with the reader, these are ignored and all other Triggers will
 * be removed and the command complete successfully.
 * @param triggerList/*  w  ww  .  j av  a2  s  .  c  om*/
 *           The list of Triggers to remove
 */
public final void removeTriggers(final Trigger[] triggerList) {

    Vector triggers = getVector(triggerList);

    Enumeration iterator = triggers.elements();
    Trigger cur;

    while (iterator.hasMoreElements()) {
        cur = (Trigger) iterator.nextElement();
        cur.removeAssociations();
        this.triggers.remove(cur.getName());
    }

}

From source file:org.accada.reader.rprm.core.ReaderDevice.java

/**
 * Removes the specified TagFields from the list of TagFields currently
 * associated with the reader. If one or more of the TagFields given are not
 * known, or if some of the TagFields to be removed are currently not
 * associated with the reader, these are ignored and all other TagFields will
 * be removed and the command complete successfully.
 * @param tagFieldList/*from w w  w .  j  a  v a 2s.co  m*/
 *           The list of TagFields to remove
 */
public final void removeTagFields(final TagField[] tagFieldList) {

    Vector tagFields = getVector(tagFieldList);

    Enumeration iterator = tagFields.elements();
    TagField cur;

    while (iterator.hasMoreElements()) {
        cur = (TagField) iterator.nextElement();
        cur.removeAssociations();
        this.tagFields.remove(cur.getName());
    }

}

From source file:org.accada.reader.rprm.core.ReaderDevice.java

/**
 * Removes the specified sources from the list of sources currently
 * associated with this reader. If one or more of the sources given are not
 * known, or if some of the sources to be removed are currently not
 * associated with this reader, these are ignored and all other sources shall
 * be removed and the command shall complete successfully. But note, in case
 * of a fixed source an exception ("ERROR_SOURCE_READ_ONLY") is thrown and
 * none of the sources will be removed/* w  w  w. j a  va2  s .c o  m*/
 * @param sourceList
 *           The list of sources to remove
 * @throws ReaderProtocolException
 *            "ERROR_SOURCE_READ_ONLY"
 */
public final void removeSources(final Source[] sourceList) throws ReaderProtocolException {

    Vector sources = getVector(sourceList);

    Enumeration iterator = sources.elements();
    Source cur;
    while (iterator.hasMoreElements()) {
        cur = (Source) iterator.nextElement();
        if (cur.isFixed()) {
            throw new ReaderProtocolException("ERROR_SOURCE_READ_ONLY",
                    MessagingConstants.ERROR_SOURCE_READ_ONLY);
        }
    }

    iterator = sources.elements();
    while (iterator.hasMoreElements()) {
        cur = (Source) iterator.nextElement();
        cur.removeAssociations();
        this.sources.remove(cur.getName());
    }

}

From source file:org.accada.reader.rprm.core.ReaderDevice.java

/**
 * Removes the specified TagSelectors from the list of TagSelectors currently
 * associated with the reader. If one or more of the TagSelectors given are
 * not known, or if some of the TagSelectors to be removed are currently not
 * associated with the reader, these are ignored and all other TagSelectors
 * will be removed and the command complete successfully.
 * @param tagSelectorList/*from  www.  jav  a2s  .  c o  m*/
 *           The list of TagSelectors to remove
 */
public final void removeTagSelectors(final TagSelector[] tagSelectorList) {

    Vector tagSelectors = getVector(tagSelectorList);

    Enumeration iterator = tagSelectors.elements();
    TagSelector cur;

    while (iterator.hasMoreElements()) {
        cur = (TagSelector) iterator.nextElement();
        cur.removeAssociations();
        this.tagSelectors.remove(cur.getName());
    }

}

From source file:org.accada.reader.rprm.core.ReaderDevice.java

/**
 * Removes the specified DataSelectors from the list of DataSelectors
 * currently associated with this reader. If one or more of the DataSelectors
 * given are not known, or if some of the DataSelectors to be removed are
 * currently not associated with this reader, these are ignored and all other
 * DataSelectors shall be removed and the command shall complete
 * successfully.//from   w  ww . jav a  2  s . c  o  m
 * @param dataSelectorList
 *           The list of DataSelectors to remove
 */
public final void removeDataSelectors(final DataSelector[] dataSelectorList) {

    Vector dataSelectors = getVector(dataSelectorList);

    Enumeration iterator = dataSelectors.elements();
    DataSelector cur;

    while (iterator.hasMoreElements()) {
        cur = (DataSelector) iterator.nextElement();
        cur.removeAssociations();
        this.dataSelectors.remove(cur.getName());
    }

}

From source file:org.accada.reader.rprm.core.ReaderDevice.java

/**
 * Removes the specified NotificationChannels from the list of
 * NotificationChannels currently associated with the reader. If one or more
 * of the NotificationChannels given are not known, or if some of the
 * NotificationChannels to be removed are currently not associated with the
 * reader, these are ignored and all other NotificationChannels shall be
 * removed and the command shall complete successfully.
 * @param notificationChannelList//ww w. j  av a 2 s .  c om
 *           The list of NotificationChannels to remove
 */
public final void removeNotificationChannels(final NotificationChannel[] notificationChannelList) {

    Vector notificationChannels = getVector(notificationChannelList);

    Enumeration iterator = notificationChannels.elements();
    NotificationChannel cur;

    while (iterator.hasMoreElements()) {
        cur = (NotificationChannel) iterator.nextElement();
        cur.removeAssociations();
        this.notificationChannels.remove(cur.getName());
    }

}

From source file:com.netscape.cmscore.usrgrp.UGSubsystem.java

protected Enumeration<IGroup> buildGroups(LDAPSearchResults res) throws EUsrGrpException {
    Vector<IGroup> v = new Vector<IGroup>();

    while (res.hasMoreElements()) {
        LDAPEntry entry = (LDAPEntry) res.nextElement();

        v.addElement(buildGroup(entry));
    }/*from w  w w. j av  a 2  s .  c om*/
    return v.elements();
}

From source file:org.agnitas.beans.impl.MailingImpl.java

@Override
public void cleanupMailingComponents(Vector<String> keep) {
    Vector<String> remove = new Vector<String>();
    MailingComponent tmp = null;//from w w  w  .jav  a2  s  .c o  m

    // first find keys which should be removed
    Iterator<MailingComponent> it = this.components.values().iterator();
    while (it.hasNext()) {
        tmp = it.next();
        if (tmp.getType() == MailingComponent.TYPE_IMAGE && !keep.contains(tmp.getComponentName())) {
            remove.add(tmp.getComponentName());
        }
    }

    // now remove them!
    Enumeration<String> e = remove.elements();
    while (e.hasMoreElements()) {
        this.components.remove(e.nextElement());
    }
}

From source file:org.apereo.portal.layout.dlm.DistributedLayoutManager.java

private Enumeration<String> getChildIds(String nodeId, boolean visibleOnly) throws PortalException {
    Vector<String> v = new Vector<String>();
    IUserLayoutNodeDescription node = getNode(nodeId);
    if (node instanceof IUserLayoutFolderDescription) {
        Document uld = this.getUserLayoutDOM();
        Element felement = uld.getElementById(nodeId);
        for (Node n = felement.getFirstChild(); n != null; n = n.getNextSibling()) {
            if (n.getNodeType() == Node.ELEMENT_NODE && (visibleOnly == false || (visibleOnly == true
                    && ((Element) n).getAttribute(Constants.ATT_HIDDEN).equals("false")))) {
                Element e = (Element) n;
                if (e.getAttribute("ID") != null) {
                    v.add(e.getAttribute("ID"));
                }/*from  ww  w  .  j a  v a 2s  .  c  om*/
            }
        }
    }
    return v.elements();
}