Example usage for java.util Vector add

List of usage examples for java.util Vector add

Introduction

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

Prototype

public synchronized boolean add(E e) 

Source Link

Document

Appends the specified element to the end of this Vector.

Usage

From source file:de.unibayreuth.bayeos.goat.table.OctetMatrixTableModel.java

private Vector getIds(Vector s) {
    Iterator it = s.iterator();//from  ww w . j a v a 2  s . c  o  m
    Vector ret = new Vector(s.capacity());
    while (it.hasNext()) {
        ret.add(((ObjektNode) it.next()).getId());
    }
    return ret;
}

From source file:net.nosleep.superanalyzer.analysis.views.RatingView.java

private void refreshDataset() {
    _dataset.clear();//w  w  w.java2s.com

    Stat itemStats = null;

    if (_comboBox == null) {
        itemStats = _analysis.getStats(Analysis.KIND_TRACK, null);
    } else {
        ComboItem item = (ComboItem) _comboBox.getSelectedItem();
        itemStats = _analysis.getStats(item.getKind(), item.getValue());
    }

    Vector<Double> counts = new Vector<Double>(6);
    double[] ratings = itemStats.getRatings();
    for (int i = 0; i < ratings.length; i++)
        counts.addElement(new Double(ratings[i]));

    Vector<String> labels = new Vector<String>(6);
    labels.add(new String(Misc.getString("NOT_RATED")));
    labels.add(new String("1 " + Misc.getString("STAR")));
    labels.add(new String("2 " + Misc.getString("STARS")));
    labels.add(new String("3 " + Misc.getString("STARS")));
    labels.add(new String("4 " + Misc.getString("STARS")));
    labels.add(new String("5 " + Misc.getString("STARS")));

    PiePlot3D plot = (PiePlot3D) _chart.getPlot();
    Color[] colors = Theme.getColorSet();
    plot.setIgnoreZeroValues(true);

    for (int i = 0; i < counts.size(); i++) {
        // if((Double)counts.elementAt(i) > 0)
        {
            _dataset.setValue((String) labels.elementAt(i), (Double) counts.elementAt(i));
            plot.setSectionPaint((String) labels.elementAt(i), colors[5 - i]);
        }
    }

}

From source file:chartsPK.LineChart.java

private XYDataset createDataset() {

    XYSeriesCollection dataset = new XYSeriesCollection();
    Vector<XYSeries> series = new Vector<>();

    for (LineChartDataSeries dataSerie : dataSeries) {
        series.add(new XYSeries(dataSerie.getTitle()));
    }//  w  w w.j  av  a 2s.  c o  m

    for (int i = 0; i < dataSeries.size(); i++) {
        for (int j = 0; j < dataSeries.get(i).getXValues().size(); j++) {
            series.get(i).add(dataSeries.get(i).getXValues().get(j), dataSeries.get(i).getYValues().get(j));
        }
    }

    for (XYSeries serie : series) {
        dataset.addSeries(serie);
    }

    return dataset;
}

From source file:chart.statistic.HistogramChart.java

public void store(String folder, String filename) {
    store(chart, new File(folder), filename);

    MesswertTabelle tab = new MesswertTabelle();
    File f = new File(folder + "/" + "TAB_" + filename + ".dat");
    Vector<Messreihe> mrs = new Vector<Messreihe>();
    mrs.add(mr);
    tab.setMessReihen(mrs);//from   w  ww .  j  a  v a2s .  com
    tab.writeToFile(f);
}

From source file:com.ibm.xsp.xflow.activiti_rest.DominoGroupManager.java

@Override
public List<Group> findGroupByQueryCriteria(GroupQueryImpl query, Page page) {
    Vector<String> names = new Vector<String>();
    if (StringUtils.isNotEmpty(query.getId())) {
        names.add(query.getId());
    }//from  www .j ava2 s  . c  om
    if (StringUtils.isNotEmpty(query.getName())) {
        names.add(query.getName());
    }
    return findGroups(names, false);
}

From source file:com.feilong.commons.core.tools.json.JsonUtilTest.java

/**
 * Test vector./* ww  w .j  a v a2  s.c  om*/
 */
@Test
public void testVector() {
    Vector<Integer> vector = new Vector<Integer>();
    vector.add(1);
    vector.add(2222);
    vector.add(3333);
    vector.add(55555);
    log.info("vector:{}", JsonUtil.format(vector));
    log.info("" + vector.get(0));
}

From source file:edu.ku.brc.specify.datamodel.Agent.java

/**
 * @return List of pick lists for predefined system type codes.
 * //from  www  .j  a  va 2s  .c o  m
 * The QueryBuilder function is used to generate picklist criteria controls for querying,
 * and to generate text values for the typed fields in query results and reports.
 * 
 * The WB uploader will also need this function.
 * 
 */
@Transient
public static List<PickListDBAdapterIFace> getSpSystemTypeCodes() {
    List<PickListDBAdapterIFace> result = new Vector<PickListDBAdapterIFace>(1);
    Vector<PickListItemIFace> stats = new Vector<PickListItemIFace>(4);
    stats.add(new TypeCodeItem(UIRegistry.getResourceString("Agent_ORG"), Agent.ORG));
    stats.add(new TypeCodeItem(UIRegistry.getResourceString("Agent_PERSON"), Agent.PERSON));
    stats.add(new TypeCodeItem(UIRegistry.getResourceString("Agent_OTHER"), Agent.OTHER));
    stats.add(new TypeCodeItem(UIRegistry.getResourceString("Agent_GROUP"), Agent.GROUP));
    result.add(new TypeCode(stats, "agentType"));
    return result;
}

From source file:hermes.browser.model.PropertySetTableModel.java

public void insertRow() throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
    Vector row = new Vector();

    row.add("");
    row.add("");// w w w.  j  a  v a2  s .co m

    rows.add(row);

    fireTableRowsInserted(rows.size() - 1, rows.size());
}

From source file:com.headstrong.npi.raas.Utils.java

public static String[] insertSection(String insertStr, String[] strArray) {
    // strArray==null assign a new array
    strArray = strArray != null ? strArray : new String[0];

    Vector<String> arrayVector = new Vector<String>(Arrays.asList(strArray));
    arrayVector.add(insertStr);
    String[] returnStr = (String[]) arrayVector.toArray(new String[0]);
    return returnStr;
}

From source file:com.fluidinfo.fom.BaseFOM.java

/**
 * Return's the instance's path in FluidDB (/objects/xyz..../ etc)
 * @return the instance's path in FluidDB
 *//*from   ww  w.ja  v  a2 s .c o  m*/
public String getPath() {
    Vector<String> paths = new Vector<String>();
    paths.add(this.rootPath);
    paths.add(this.path);
    return StringUtil.URIJoin(paths);
}