Example usage for java.util Vector addAll

List of usage examples for java.util Vector addAll

Introduction

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

Prototype

public boolean addAll(Collection<? extends E> c) 

Source Link

Document

Appends all of the elements in the specified Collection to the end of this Vector, in the order that they are returned by the specified Collection's Iterator.

Usage

From source file:org.apache.shindig.gadgets.servlet.ServletUtilTest.java

Enumeration<String> makeEnumeration(String... args) {
    Vector<String> vector = new Vector<String>();
    vector.addAll(Arrays.asList(args));
    return vector.elements();
}

From source file:org.jboss.dashboard.ui.controller.RequestMultipartWrapper.java

/**
 * Returns the parameter names on the MultipartRequest that are of type file
 *
 * @return An Enumeration containing all the Parameter Names
 *///  w w  w  .j  av  a2  s  .  co  m
public Enumeration<String> getFileParameterNames() {
    Vector<String> names = new Vector<String>(requestFiles.size());
    names.addAll(requestFiles.keySet());
    return names.elements();
}

From source file:edu.lternet.pasta.dml.parser.document.DocumentDataPackageParser.java

private Vector getRecordRow() {
    Vector row = new Vector();
    row.addAll(record.values());

    return row;
}

From source file:org.jbpm.formModeler.service.bb.mvc.controller.RequestMultipartWrapper.java

/**
 * Returns the parameter names on the MultipartRequest
 *
 * @return An Enumeration containing all the Parameter Names
 *///from  ww w  .ja va  2  s  .  com
public Enumeration getParameterNames() {
    Vector names = new Vector(requestParameters.size() + requestFiles.size());
    names.addAll(requestParameters.keySet());
    names.addAll(requestFiles.keySet());
    return names.elements();
}

From source file:com.celements.web.contextmenu.ContextMenuBuilder.java

@SuppressWarnings("unchecked")
private List getCMIobjects(String className, XWikiContext context) throws XWikiException {
    String fullName = "CelementsContextMenu." + className;
    Vector cmiObjects = new Vector();
    if (context.getWiki().exists("celements2web:" + fullName, context)) {
        cmiObjects.addAll(context.getWiki().getDocument("celements2web:" + fullName, context)
                .getObjects(ContextMenuItem.CONTEXTMENUITEM_CLASSNAME));
    }/*from  w w  w. j  a v  a  2 s  . c  o m*/
    if (context.getWiki().exists(fullName, context)) {
        cmiObjects.addAll(context.getWiki().getDocument(fullName, context)
                .getObjects(ContextMenuItem.CONTEXTMENUITEM_CLASSNAME));
    }
    return cmiObjects;
}

From source file:org.kchine.rpf.db.ServantProxyFactoryDB.java

public Object makeObject() throws Exception {
    Vector<String> servantNames = new Vector<String>();

    try {/*from   w  ww .  j ava 2  s . co  m*/

        try {

            _dbLayer.lock();
            servantNames.addAll(_dbLayer.list(_poolData.getPrefixes()));
            // System.out.println("servant Names : " + servantNames);
        } catch (Exception e) {
            e.printStackTrace();
            throw new NoSuchElementException("No R Servant available / No DB ");
        }

        Vector<Integer> order = null;
        if (servantNames.size() > 0)
            order = PoolUtils.getRandomOrder(servantNames.size());

        for (int i = 0; i < servantNames.size(); ++i) {
            try {

                ManagedServant servant = (ManagedServant) _dbLayer
                        .lookup(servantNames.elementAt(order.elementAt(i)));
                PoolUtils.ping(servant);
                _dbLayer.reserve(servantNames.elementAt(order.elementAt(i)));
                return servant;
            } catch (LookUpTimeout e) {
                _dbLayer.registerPingFailure(servantNames.elementAt(order.elementAt(i)));
            } catch (RemoteException re) {

                if (re.getCause() instanceof InitializingException) {
                } else {
                    _dbLayer.registerPingFailure(servantNames.elementAt(order.elementAt(i)));
                }

            }
        }

    } finally {
        _dbLayer.unlock();
        _dbLayer.commit();
    }

    throw new NoSuchElementException("No Servant available");
}

From source file:org.eclipse.jubula.autagent.commands.StartRcpAutServerCommand.java

/**
 * {@inheritDoc}//from  w  w w.j  a  v a2 s. c  o m
 */
protected String[] createEnvArray(Map<String, String> parameters, boolean isAgentSet) {

    String[] envArray = super.createEnvArray(parameters, isAgentSet);
    if (envArray == null) {
        envArray = EnvironmentUtils.propToStrArray(EnvironmentUtils.getProcessEnvironment(),
                IStartAut.PROPERTY_DELIMITER);
    }
    Vector<String> envList = new Vector<String>(Arrays.asList(envArray));
    envList.addAll(getConnectionProperties(parameters, StartSwtAutServerCommand.ENV_VALUE_SEP));

    if (MonitoringUtil.shouldAndCanRunWithMonitoring(parameters)) {
        String monAgent = this.getMonitoringAgent(parameters);
        if (monAgent != null) {
            StringBuffer sb = new StringBuffer();
            sb.append(JAVA_OPTIONS_INTRO);
            sb.append(monAgent);
            envList.add(sb.toString());
            envArray = super.createEnvArray(parameters, true);
        }
    }
    envArray = envList.toArray(new String[envList.size()]);

    return envArray;
}

From source file:gda.device.scannable.ScannableUtils.java

/**
 * @param scannables/*  ww w .j  av a  2s  . c  o  m*/
 * @return list of Input and ExtraNames from the provided list of Scannable
 */
public static List<String> getScannableFieldNames(List<Scannable> scannables) {
    Vector<String> fieldNames = new Vector<String>();
    for (Scannable s : scannables) {
        // if detector the inputNames are not returned in ScanDataPoint so do not add
        String[] extraNames = s.getExtraNames();
        if (s instanceof Detector) {
            if (extraNames.length > 0) {
                fieldNames.addAll(Arrays.asList(extraNames));
            } else {
                fieldNames.add(s.getName());
            }
        } else {
            fieldNames.addAll(Arrays.asList(s.getInputNames()));
            fieldNames.addAll(Arrays.asList(extraNames));
        }
    }
    return fieldNames;
}

From source file:org.jboss.dashboard.ui.controller.RequestMultipartWrapper.java

/**
 * Returns the parameter names on the MultipartRequest
 *
 * @return An Enumeration containing all the Parameter Names
 *///  w w w .j  av a  2s .co m
public Enumeration<String> getParameterNames() {
    Vector<String> names = new Vector<String>(requestParameters.size() + requestFiles.size());
    names.addAll(requestParameters.keySet());
    names.addAll(requestFiles.keySet());
    return names.elements();
}

From source file:org.openmrs.module.openhmis.inventory.web.controller.InventoryMessageRenderController.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView render(HttpServletRequest request) {
    // object to store keys from inventory and backboneforms
    Vector<String> keys = new Vector<String>();

    Locale locale = RequestContextUtils.getLocale(request);
    ResourceBundle resourceBundle = ResourceBundle.getBundle("messages", locale);

    // store inventory message keys in the vector object
    keys.addAll(resourceBundle.keySet());

    // retrieve backboneforms messages
    BackboneMessageRenderController backboneController = new BackboneMessageRenderController();
    ModelAndView modelAndView = backboneController.render(request);

    // store backboneforms message keys in the vector object
    for (Map.Entry<String, Object> messageKeys : modelAndView.getModel().entrySet()) {
        Enumeration<String> messageKey = (Enumeration<String>) messageKeys.getValue();
        while (messageKey.hasMoreElements()) {
            String key = messageKey.nextElement();
            if (!keys.contains(key))
                keys.add(key);/*from   w w  w . j a va 2 s  .com*/
        }
    }

    return new ModelAndView(ModuleWebConstants.MESSAGE_PAGE, "keys", keys.elements());
}