Example usage for java.util Vector Vector

List of usage examples for java.util Vector Vector

Introduction

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

Prototype

public Vector() 

Source Link

Document

Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.

Usage

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  ww. j  a  v  a2 s .  c  om
        }
    }

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

From source file:io.jjcastillo.bconferencia.model.Auditorio.java

public Vector getConferenciasVector() {
    Vector v = new Vector();
    for (Conferencia c : conferencias) {
        Vector v1 = new Vector();
        v1.add(c.getNombre());//  ww w.ja  va2 s  .c  o  m
        v1.add(HelperUtil.formatDate(c.getFechaInicio()));
        v1.add(HelperUtil.formatDate(c.getFechaFin()));
        v1.add(HelperUtil.PrettifyDateDiff(c.getFechaFin().getTime() - c.getFechaInicio().getTime()));
        v.add(v1);
    }
    return v;
}

From source file:com.maverick.http.HttpHeader.java

protected HttpHeader() {
    fields = new Hashtable();
    fieldNames = new Vector();
}

From source file:com.sbu.controller.ServletPersonalStartupController.java

@Override
public void init() throws ServletException {
    WebApplicationContext context = WebApplicationContextUtils
            .getRequiredWebApplicationContext(getServletContext());
    startupService = context.getBean(StartupManager.class);
    memberService = context.getBean(MemberManager.class);
    members = new Vector<>();
}

From source file:forseti.JSubirArchivo.java

@SuppressWarnings({ "rawtypes", "unchecked" })
public JSubirArchivo(long MaxSize, String Path, String[] Exts, boolean[] Frz) {
    m_MaxSize = MaxSize;//from ww  w .j  a v a2s  .c  o m
    m_Path = Path;
    m_Error = "";
    m_Files = new Vector();
    for (int i = 0; i < Exts.length; i++) {
        MyUploadedFiles f = new MyUploadedFiles();
        f.m_Ext = Exts[i];
        f.m_File = "";
        f.m_Frz = Frz[i];
        m_Files.addElement(f);
    }
}

From source file:edu.ku.brc.ui.CsvTableModel.java

public CsvTableModel(File csvFile) throws Exception {
    listeners = new Vector<TableModelListener>();
    rand = new Random();
    randStart = rand.nextInt(2756);//from ww w . j av  a2 s  .co  m

    rowData = new Vector<String[]>();
    methods = new Vector<String>();

    this.csvFile = csvFile;
    FileReader fr = new FileReader(csvFile);
    BufferedReader br = new BufferedReader(fr);

    // first line is header
    String line = br.readLine();
    header = StringUtils.split(line);
    line = br.readLine();
    while (line != null) {
        String[] row = StringUtils.split(line);
        if (row.length > 0) {
            rowData.add(row);
        }
        line = br.readLine();
    }

    for (int i = 0; i < rowData.size(); ++i) {
        //setup a method
        int j = rand.nextInt(15);
        if (j == 0) {
            methods.add("dynamite");
        } else if (j == 1) {
            methods.add("boat electro-shocker");
        } else {
            methods.add("seine");
        }
    }
}

From source file:org.guanxi.idp.util.ARPEngine.java

public void init() {
    arpFiles = new Vector<Arp>();

    try {/*w ww  .j  a  v  a2  s  .  co m*/
        loadARPs(arpFile);
    } catch (GuanxiException ge) {
    }
}

From source file:BeanPropertyTableModel.java

public void refresh() throws RuntimeException {
    final Vector<Object> columnNames = new Vector<Object>();
    columnNames.add(_nameColumnName);/*from   w w w .  j  a v a  2 s  . c  om*/
    columnNames.add(_valueColumnName);
    final Vector<Object> columnData = new Vector<Object>();
    if (_bean != null) {
        try {
            BeanInfo info = Introspector.getBeanInfo(_bean.getClass(), Introspector.USE_ALL_BEANINFO);
            processBeanInfo(info, columnData);
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }

    // Sort the rows by the property name.
    Collections.sort(columnData, new DataSorter());

    setDataVector(columnData, columnNames);
}

From source file:de.highbyte_le.weberknecht.i18n.LocaleMatcher.java

/**
 * @param bundleName//from w  w w.j  a va  2  s  .  co m
 *       the name of your localization bundle
 * @param locales
 *       the locales accepted by the user (usually from the 'Accept-Language' header, available via HttpServletRequest.getLocales())
 */
public LocaleMatcher(String bundleName, Enumeration<Locale> locales) {
    this.bundleName = bundleName;

    this.locales = new Vector<Locale>();
    while (locales.hasMoreElements())
        this.locales.add(locales.nextElement());
}

From source file:com.alfaariss.oa.sso.web.profile.ssoquery.whitelist.config.ConfigWhitelist.java

/**
 * Constructor. 
 */
public ConfigWhitelist() {
    _logger = LogFactory.getLog(this.getClass());
    _listItems = new Vector<String>();
}