Package java.util

Examples of java.util.Vector


   *
   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {

    Vector newVector = new Vector(5);

    newVector.addElement(new Option(
              "\tChoose attribute to be used for selection.",
              "C", 1, "-C <num>"));
    newVector.addElement(new Option(
              "\tNumeric value to be used for selection on numeric\n"+
        "\tattribute.\n"+
        "\tInstances with values smaller than given value will\n"+
              "\tbe selected. (default 0)",
              "S", 1, "-S <num>"));
    newVector.addElement(new Option(
              "\tRange of label indices to be used for selection on\n"+
        "\tnominal attribute.\n"+
        "\tFirst and last are valid indexes. (default all values)",
              "L", 1, "-L <index1,index2-index4,...>"));
    newVector.addElement(new Option(
        "\tMissing values count as a match. This setting is\n"+
              "\tindependent of the -V option.\n"+
              "\t(default missing values don't match)",
              "M", 0, "-M"));
    newVector.addElement(new Option(
        "\tInvert matching sense.",
              "V", 0, "-V"));
    newVector.addElement(new Option(
        "\tWhen selecting on nominal attributes, removes header\n"
        + "\treferences to excluded values.",
              "H", 0, "-H"));

    return newVector.elements();
  }
View Full Code Here


   *
   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {

    Vector newVector = new Vector(2);

    newVector.addElement(new Option(
              "\tNumber of execution slots.\n"
              + "\t(default 1 - i.e. no parallelism)",
              "num-slots", 1, "-num-slots <num>"));

    Enumeration enu = super.listOptions();
    while (enu.hasMoreElements()) {
      newVector.addElement(enu.nextElement());
    }
    return newVector.elements();
  }
View Full Code Here

   * Returns an enumeration describing the available options.
   *
   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {
    Vector  result;
   
    result = new Vector();

    result.addElement(new Option(
  "\tThe expression to use for filtering\n"
  + "\t(default: true).",
  "E", 1, "-E <expr>"));

    return result.elements();
  }
View Full Code Here

   * @return an array of strings suitable for passing to setOptions
   */
  public String[] getOptions() {
    Vector<String>  result;
   
    result = new Vector();

    result.add("-E");
    result.add("" + getExpression());

    return result.toArray(new String[result.size()]);
View Full Code Here

   * Returns an enumeration describing the available options.
   *
   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {
    Vector  result;
   
    result = new Vector();

    result.addElement(new Option(
  "\tThe regular expression that the attribute names must match.\n"
  + "\t(default: ([\\s\\S]+))",
  "find", 1, "-find <regexp>"));

    result.addElement(new Option(
  "\tThe regular expression to replace matching attributes with.\n"
  + "\t(default: $0)",
  "replace", 1, "-replace <regexp>"));

    result.addElement(new Option(
  "\tReplaces all occurrences instead of just the first.\n"
  + "\t(default: only first occurrence)",
  "all", 0, "-all"));

    result.addElement(new Option(
  "\tThe attribute range to work on.\n"
  + "This is a comma separated list of attribute indices, with "
        + "\"first\" and \"last\" valid values.\n"
        + "\tSpecify an inclusive range with \"-\".\n"
        + "\tE.g: \"first-3,5,6-10,last\".\n"
  + "\t(default: first-last)",
  "R", 1, "-R <range>"));

    result.addElement(new Option(
  "\tInverts the attribute selection range.\n"
  + "\t(default: off)",
  "V", 0, "-V"));

    return result.elements();
  }
View Full Code Here

   *
   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {

    Vector newVector = new Vector(2);

    newVector.addElement(new Option(
              "\tNumber of execution slots.\n"
              + "\t(default 1 - i.e. no parallelism)",
              "num-slots", 1, "-num-slots <num>"));

    Enumeration enu = super.listOptions();
    while (enu.hasMoreElements()) {
      newVector.addElement(enu.nextElement());
    }
    return newVector.elements();
  }
View Full Code Here

    return (ResourceXmlBean) roots.get(id);
  }

  protected static Vector getItems() {
    Enumeration elts = roots.elements();
    Vector retour = new Vector();
    while (elts.hasMoreElements()) {
      retour.add(elts.nextElement());
    }
    return retour;
  }
View Full Code Here

      PublicationResult r = new PublicationResult();
      r._publi = p;
      if (view != null) {
        r._view = new String(Viewer.getView(p, view));
      }
      Vector v2 = new Vector();
      v2.add(r);
      return v2;
    } catch (Exception e) {
      Logger.getInstance().error("Erreur du SelectObject", this, e);
      throw new SelectException(e.getMessage());
    }
View Full Code Here

    }

    @Test
    public void testViewChangeReceptionOnChannelCloseByParticipant() throws Exception {
        Address a1, a2;
        Vector members;
        MyReceiver r1=new MyReceiver(), r2=new MyReceiver();

        c1.set(createChannel(true));
        c1.get().setReceiver(r1);
        System.out.println("-- connecting c1");
        final String GROUP="CloseTest.testViewChangeReceptionOnChannelCloseByParticipant";
        c1.get().connect(GROUP);
        Util.sleep(500); // time to receive its own view
        System.out.println("c1: " + r1.getViews());
        a1=c1.get().getAddress();
        c2.set(createChannel(c1.get()));
        c2.get().setReceiver(r2);
        System.out.println("-- connecting c2");
        r1.clearViews();
        c2.get().connect(GROUP);
        Util.sleep(500); // time to receive its own view
        a2=c2.get().getAddress();
        System.out.println("c2: " + r2.getViews());

        System.out.println("-- closing c2");
        c2.get().close();
        Util.sleep(500);
        View v=r1.getViews().get(0);
        members=v.getMembers();
        System.out.println("-- first view of c1: " + v);
        Assert.assertEquals(2, members.size());
        assertTrue(members.contains(a1));
        assertTrue(members.contains(a2));

        v=r1.getViews().get(1);
        members=v.getMembers();
        System.out.println("-- second view of c1: " + v);
        assert 1 == members.size();
        assert members.contains(a1);
        assert !members.contains(a2);
    }
View Full Code Here

    }

    @Test
    public void testViewChangeReceptionOnChannelCloseByCoordinator() throws Exception {
        Address a1, a2;
        Vector members;
        MyReceiver r1=new MyReceiver(), r2=new MyReceiver();

        final String GROUP=getUniqueClusterName("CloseTest.testViewChangeReceptionOnChannelCloseByCoordinator");
        c1.set(createChannel(true));
        c1.get().setReceiver(r1);
        c1.get().connect(GROUP);
        Util.sleep(500); // time to receive its own view
        a1=c1.get().getAddress();
        c2.set(createChannel(c1.get()));
        c2.get().setReceiver(r2);
        c2.get().connect(GROUP);
        Util.sleep(500); // time to receive its own view
        a2=c2.get().getAddress();
        View v=r2.getViews().get(0);
        members=v.getMembers();
        assert 2 == members.size();
        assert members.contains(a2);

        r2.clearViews();
        c1.get().close();
        Util.sleep(1000);

        v=r2.getViews().get(0);
        members=v.getMembers();
        assert 1 == members.size();
        assert !members.contains(a1);
        assert members.contains(a2);
        assert c2.get().getNumMessages() == 0;
    }
View Full Code Here

TOP

Related Classes of java.util.Vector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.