Package java.util

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


      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

   * @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

    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

    // ... 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

   *
   * @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

   *
   * @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

     *
     * @return String[] of file extensions
     */
    public String[] extensions() {
        String[] ext = new String[fileTypes.size()];
        Enumeration e = fileTypes.elements();
        int i = 0;
        while (e.hasMoreElements()) {
            ext[i++] = (String)e.nextElement();
        }
        return ext;
    }
View Full Code Here

   * @return enumeration of all the attribute's values
   */
  public final /*@ pure @*/ Enumeration enumerateValues() {

    if (isNominal() || isString()) {
      final Enumeration ee = new WekaEnumeration(m_Values);
      return new Enumeration () {
          public boolean hasMoreElements() {
            return ee.hasMoreElements();
          }
          public Object nextElement() {
            Object oo = ee.nextElement();
            if (oo instanceof SerializedObject) {
              return ((SerializedObject)oo).getObject();
            } else {
              return oo;
            }
View Full Code Here

   
    text.append(ARFF_ATTRIBUTE).append(" ").append(Utils.quote(m_Name)).append(" ");
    switch (m_Type) {
    case NOMINAL:
      text.append('{');
      Enumeration enu = enumerateValues();
      while (enu.hasMoreElements()) {
  text.append(Utils.quote((String) enu.nextElement()));
  if (enu.hasMoreElements())
    text.append(',');
      }
      text.append('}');
      break;
    case NUMERIC:
      text.append(ARFF_ATTRIBUTE_NUMERIC);
      break;
    case STRING:
      text.append(ARFF_ATTRIBUTE_STRING);
      break;
    case DATE:
      text.append(ARFF_ATTRIBUTE_DATE).append(" ").append(Utils.quote(m_DateFormat.toPattern()));
      break;
    case RELATIONAL:
      text.append(ARFF_ATTRIBUTE_RELATIONAL).append("\n");
      Enumeration enm = m_Header.enumerateAttributes();
      while (enm.hasMoreElements()) {
        text.append(enm.nextElement()).append("\n");
      }
      text.append(ARFF_END_SUBRELATION).append(" ").append(Utils.quote(m_Name));
      break;
    default:
      text.append("UNKNOWN");
View Full Code Here

TOP

Related Classes of java.util.Enumeration

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.