Package java.util

Examples of java.util.Enumeration


    else {
      m_Values = Utils.cast(m_Values.clone());
      m_Values.remove(index);
      if (!isRelationValued()) {
        Hashtable<Object,Integer> hash = new Hashtable<Object,Integer>(m_Hashtable.size());
        Enumeration enu = m_Hashtable.keys();
        while (enu.hasMoreElements()) {
          Object string = enu.nextElement();
          Integer valIndexObject = (Integer)m_Hashtable.get(string);
          int valIndex = valIndexObject.intValue();
          if (valIndex > index) {
            hash.put(string, new Integer(valIndex - 1));
          } else if (valIndex < index) {
View Full Code Here


   *
   * @param value  the new weight
   */
  public void setWeight(double value) {
    Properties  props;
    Enumeration names;
    String  name;
   
    m_Weight = value;

    // generate new metadata object
    props = new Properties();
    names = m_Metadata.propertyNames();
    while (names.hasMoreElements()) {
      name = (String) names.nextElement();
      if (!name.equals("weight"))
  props.setProperty(name, m_Metadata.getProperty(name));
    }
    props.setProperty("weight", "" + m_Weight);
    m_Metadata = new ProtectedProperties(props);
View Full Code Here

      // Print the name of "position"
      System.out.println("Name of \"position\": " + position.name());

      // Print the values of "position"
      Enumeration attValues = position.enumerateValues();
      while (attValues.hasMoreElements()) {
  String string = (String)attValues.nextElement();
  System.out.println("Value of \"position\": " + string);
      }

      // Shallow copy attribute "position"
      Attribute copy = (Attribute) position.copy();
View Full Code Here

    // Get scheme-specific options
    if (classifier instanceof OptionHandler) {
      optionsText.append("\nOptions specific to "
          + classifier.getClass().getName()
          + ":\n\n");
      Enumeration enu = ((OptionHandler)classifier).listOptions();
      while (enu.hasMoreElements()) {
        Option option = (Option) enu.nextElement();
        optionsText.append(option.synopsis() + '\n');
        optionsText.append(option.description() + "\n");
      }
    }
View Full Code Here

       "R", 1, "-R <num>"));
    vec.addElement(new Option(
        "\tUse pairwise coupling (only has an effect for 1-against1)",
        "P", 0, "-P"));

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

      iq.setOptions(args);
      try {
  Utils.checkForRemainingOptions(args);
      } catch (Exception e) {
  System.err.println("Options for weka.experiment.InstanceQuery:\n");
  Enumeration en = iq.listOptions();
  while (en.hasMoreElements()) {
    Option o = (Option)en.nextElement();
    System.err.println(o.synopsis()+"\n"+o.description());
  }
  System.exit(1);
      }
    
View Full Code Here

      BufferedInputStream bi = new BufferedInputStream(new FileInputStream(propsFile));
      editorProps.load(bi);
      bi.close();
      bi = null;
     
      Enumeration enm = editorProps.propertyNames();
      while (enm.hasMoreElements()) {
        String name = enm.nextElement().toString();
        String value = editorProps.getProperty(name, "");
        System.err.println("Registering " + name + " " +value);
        GenericObjectEditor.registerEditor(name, value);
      }
     
View Full Code Here

     *
     * @return  download file count
     */
    public synchronized int getDownloadCount() {
        int count = 0;
        Enumeration e = clients.elements();
        while (e.hasMoreElements()) {
            FTPClientInterface client = (FTPClientInterface)e.nextElement();
            count += client.getDownloadCount();
        }
        return count;
    }
View Full Code Here

     *
     * @return  upload file count
     */
    public synchronized int getUploadCount() {
        int count = 0;
        Enumeration e = clients.elements();
        while (e.hasMoreElements()) {
            FTPClientInterface client = (FTPClientInterface)e.nextElement();
            count += client.getUploadCount();
        }
        return count;
    }
View Full Code Here

     *
     * @return  deleted file count
     */
    public synchronized int getDeleteCount() {
        int count = 0;
        Enumeration e = clients.elements();
        while (e.hasMoreElements()) {
            FTPClientInterface client = (FTPClientInterface)e.nextElement();
            count += client.getDeleteCount();
        }
        return count;
    }
View Full Code Here

TOP

Related Classes of java.util.Enumeration

Copyright © 2015 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.