Examples of Enumeration


Examples of java.util.Enumeration

    if ((m_BaseClassifier != null) &&
  (m_BaseClassifier instanceof OptionHandler)) {
      newVector.addElement(new Option("", "", 0, "\nOptions specific to scheme "
              + m_BaseClassifier.getClass().getName()
              + ":"));
      Enumeration enu = ((OptionHandler)m_BaseClassifier).listOptions();

      while (enu.hasMoreElements()) {
        newVector.addElement(enu.nextElement());
      }
    }

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

Examples of java.util.Enumeration

  /**
   * registers all the editors in Weka.
   */
  public static void registerEditors() {
    Properties     props;
    Enumeration   enm;
    String     name;
    String     value;
    Class     baseCls;
    Class    cls;

    if (m_EditorsRegistered)
      return;
   
    System.err.println("---Registering Weka Editors---");
    m_EditorsRegistered = true;

    // load properties
    try {
      props = Utils.readProperties(GUIEDITORS_PROPERTY_FILE);
    }
    catch (Exception e) {
      props = new Properties();
      e.printStackTrace();
    }
   
    enm = props.propertyNames();
    while (enm.hasMoreElements()) {
      name  = enm.nextElement().toString();
      value = props.getProperty(name, "");
     
      registerEditor(name, value);
    }
  }
View Full Code Here

Examples of java.util.Enumeration

   * the hashtable (with the root element as key)
   */
  public static Hashtable sortClassesByRoot(String classes) {
    Hashtable                 roots;
    Hashtable                 result;
    Enumeration               enm;
    int                       i;
    StringTokenizer           tok;
    String                    clsname;
    Vector                    list;
    HierarchyPropertyParser   hpp;
    String                    separator;
    String                    root;
    String                    tmpStr;
   
    if (classes == null)
      return null;
   
    roots     = new Hashtable();
    hpp       = new HierarchyPropertyParser();
    separator = hpp.getSeperator();
   
    // go over all classnames and store them in the hashtable, with the
    // root element as the key
    tok   = new StringTokenizer(classes, ", ");
    while (tok.hasMoreElements()) {
      clsname = tok.nextToken();
      root    = getRootFromClass(clsname, separator);
      if (root == null)
        continue;
     
      // already stored?
      if (!roots.containsKey(root)) {
        list = new Vector();
        roots.put(root, list);
      }
      else {
        list = (Vector) roots.get(root);
      }
     
      list.add(clsname);
    }
   
    // build result
    result = new Hashtable();
    enm    = roots.keys();
    while (enm.hasMoreElements()) {
      root = (String) enm.nextElement();
      list = (Vector) roots.get(root);
      tmpStr = "";
      for (i = 0; i < list.size(); i++) {
        if (i > 0)
          tmpStr += ",";
View Full Code Here

Examples of java.util.Enumeration

       + PROPERTY_FILE + "\n"
       + "for " + className);
      */
    } else {       
      try {
        Enumeration enm = typeOptions.keys();
        while (enm.hasMoreElements()) {
          String root = (String) enm.nextElement();
          String typeOption = (String) typeOptions.get(root);
          HierarchyPropertyParser hpp = new HierarchyPropertyParser();
          hpp.build(typeOption, ", ");
    hpps.put(root, hpp);
        }
View Full Code Here

Examples of java.util.Enumeration

      return;
   
   
    Hashtable hpps = getClassesFromProperties();
    HierarchyPropertyParser hpp = null;
    Enumeration enm = hpps.elements();
   
    try{
      while (enm.hasMoreElements()) {
        hpp = (HierarchyPropertyParser) enm.nextElement();
        if(hpp.depth() > 0) {   
          hpp.goToRoot();
          while(!hpp.isLeafReached())
            hpp.goToChild(0);
         
View Full Code Here

Examples of java.util.Enumeration

   * @param hpps the hierarchy of objects to mirror in the tree
   * @return a JTree representation of the hierarchy
   */
  protected JTree createTree(Hashtable hpps) {
    GOETreeNode             superRoot;
    Enumeration             enm;
    HierarchyPropertyParser hpp;
   
    if (hpps.size() > 1)
      superRoot = new GOETreeNode("root");
    else
      superRoot = null;

    enm = hpps.elements();
    while (enm.hasMoreElements()) {
      hpp = (HierarchyPropertyParser) enm.nextElement();
      hpp.goToRoot();
      GOETreeNode root = new GOETreeNode(hpp.getValue());
      addChildrenToTree(root, hpp);
     
      if (superRoot == null)
View Full Code Here

Examples of java.util.Enumeration

    else {
      m_ZeroR = null;
    }
   
    // for each attribute ...
    Enumeration enu = instances.enumerateAttributes();
    while (enu.hasMoreElements()) {
      try {
  OneRRule r = newRule((Attribute) enu.nextElement(), data);

  // if this attribute is the best so far, replace the rule
  if (noRule || r.m_correct > m_rule.m_correct) {
    m_rule = r;
  }
View Full Code Here

Examples of java.util.Enumeration

    // ... create arrays to hold the counts
    int[][] counts = new int [attr.numValues()]
                             [data.classAttribute().numValues()];
     
    // ... calculate the counts
    Enumeration enu = data.enumerateInstances();
    while (enu.hasMoreElements()) {
      Instance i = (Instance) enu.nextElement();
      if (i.isMissing(attr)) {
  missingValueCounts[(int) i.classValue()]++;
      } else {
  counts[(int) i.value(attr)][(int) i.classValue()]++;
      }
View Full Code Here

Examples of java.util.Enumeration

   *
   * @return     an enumeration of all the available options.
   */
  public Enumeration listOptions() {
    Vector result = new Vector();
    Enumeration enm = super.listOptions();
    while (enm.hasMoreElements())
      result.add(enm.nextElement());

    result.addElement(new Option(
        "\tA filter to apply (can be specified multiple times).",
        "F", 1, "-F <classname [options]>"));

View Full Code Here

Examples of java.util.Enumeration

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

    result = new Vector();

    enm = super.listOptions();
    while (enm.hasMoreElements())
      result.addElement(enm.nextElement());

    result.addElement(new Option(
  "\tThe file containing the serialized model.\n"
  + "\t(required)",
  "model", 1, "-model <filename>"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.