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:MainClass.java

public static PKCS10CertificationRequest generateRequest(KeyPair pair) throws Exception {
    GeneralNames subjectAltName = new GeneralNames(new GeneralName(GeneralName.rfc822Name, "test@test.test"));
    Vector oids = new Vector();
    Vector values = new Vector();

    oids.add(X509Extensions.SubjectAlternativeName);
    values.add(new X509Extension(false, new DEROctetString(subjectAltName)));

    X509Extensions extensions = new X509Extensions(oids, values);

    Attribute attribute = new Attribute(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest,
            new DERSet(extensions));

    return new PKCS10CertificationRequest("SHA256withRSA", new X500Principal("CN=Requested Test Certificate"),
            pair.getPublic(), new DERSet(attribute), pair.getPrivate());
}

From source file:maltcms.ui.fileHandles.properties.tools.ModelBuilder.java

public static WidgetTableModel getModel(Configuration properties, Object bean) {

    Vector<String> header = new Vector<>();
    header.add("Key");
    header.add("Value");
    Logger.getLogger(ModelBuilder.class.getName()).log(Level.INFO, "properties: {0}", properties);

    return new WidgetTableModel(header, PropertyLoader.asHash(properties), bean);
}

From source file:Main.java

public static Vector arrayToVector(Object[] list) {
    Vector v = new Vector();
    for (int i = 0; i < list.length; i++)
        v.add(list[i]);
    return (v);/*w w w .ja  v  a 2 s  .co  m*/
}

From source file:Main.java

public static Object[] toArray(Iterator anIterator, Class eachElementType) {
    Vector vector = new Vector();
    while (anIterator.hasNext())
        vector.add(anIterator.next());

    return toArray(vector, eachElementType);
}

From source file:Main.java

public static Hashtable<Integer, Vector<Integer>> getNodeMembership(final Vector<Vector<Integer>> CmtyVV) {
    Hashtable<Integer, Vector<Integer>> NIDComVH = new Hashtable<Integer, Vector<Integer>>();
    for (int CID = 0; CID < CmtyVV.size(); CID++) {
        for (Integer NID : CmtyVV.get(CID)) {
            if (!NIDComVH.contains(NID)) {
                Vector<Integer> v = new Vector<Integer>();
                v.add(CID);
                NIDComVH.put(NID, v);/* w w  w.  jav a2  s.c o  m*/
            } else {
                Vector<Integer> v = NIDComVH.get(NID);
                v.add(CID);
                NIDComVH.put(NID, v);
            }
        }
    }
    return NIDComVH;
}

From source file:Main.java

public static Vector<String> getSets(String setString) {
    StringTokenizer tokenizer = new StringTokenizer(setString, ";");
    Vector<String> sets = new Vector<String>();
    while (tokenizer.hasMoreTokens()) {
        sets.add(tokenizer.nextToken());
    }/* w  ww .j av  a2 s  .  com*/
    if (sets.size() == 0)
        sets.add("");
    return sets;
}

From source file:Main.java

public static <T> List<T> vector(T... source) {
    Vector<T> r = new Vector<T>(source.length);
    for (int i = 0; i < source.length; i++) {
        r.add(source[i]);
    }/*from www  .java2s.  c  o  m*/
    return r;
}

From source file:no.met.jtimeseries.netcdf.NetcdfMeteogramWrapper.java

private static void scenario4() throws Exception {
    String url = "http://thredds.met.no/thredds/dodsC/cryoclim/met.no/osisaf-nh-agg";
    Vector<String> parameters = new Vector<String>();
    parameters.add("numdays");
    Location location = new Location(11, 69);
    showChart(getChart(url, location, parameters, ParameterReference.VARIABLE_NAME, null));
}

From source file:no.met.jtimeseries.netcdf.NetcdfMeteogramWrapper.java

private static void scenario5() throws Exception {
    String url = "http://thredds.met.no/thredds/dodsC/cryoclim/met.no/osisaf-nh-agg";
    Vector<String> parameters = new Vector<String>();
    parameters.add("mean_ice_extent");
    Location location = null;//from ww w . j  a v a2 s  . co m
    showChart(getChart(url, location, parameters, ParameterReference.VARIABLE_NAME, null));
}

From source file:no.met.jtimeseries.netcdf.NetcdfMeteogramWrapper.java

private static void scenario1() throws Exception {
    String url = "http://dev-vm188.met.no/thredds/dodsC/cryoclim/indicators/myfile.nc";
    Vector<String> parameters = new Vector<String>();
    parameters.add("gsl[Comfortlessbreen]");
    parameters.add("gsl[Kuhrbreen]");
    String header = "Some header";
    showChart(getChart(url, null, parameters, ParameterReference.VARIABLE_NAME, header));
}