Package java.util

Examples of java.util.Vector$Itr


   * Notify all text listeners of a TextEvent
   *
   * @param te a <code>TextEvent</code> value
   */
  private void notifyTextListeners(TextEvent te) {
    Vector l;
    synchronized (this) {
      l = (Vector)m_textListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  //  System.err.println("Notifying text listeners "
  //         +"(ClassifierPerformanceEvaluator)");
  ((TextListener)l.elementAt(i)).acceptText(te);
      }
    }
  }
View Full Code Here


   * Notify all ThresholdDataListeners of a ThresholdDataEvent
   *
   * @param te a <code>ThresholdDataEvent</code> value
   */
  private void notifyThresholdListeners(ThresholdDataEvent re) {
    Vector l;
    synchronized (this) {
      l = (Vector)m_thresholdListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  //  System.err.println("Notifying text listeners "
  //         +"(ClassifierPerformanceEvaluator)");
  ((ThresholdDataListener)l.elementAt(i)).acceptDataSet(re);
      }
    }
  }
View Full Code Here

   * Notify all VisualizableErrorListeners of a VisualizableErrorEvent
   *
   * @param te a <code>VisualizableErrorEvent</code> value
   */
  private void notifyVisualizableErrorListeners(VisualizableErrorEvent re) {
    Vector l;
    synchronized (this) {
      l = (Vector)m_visualizableErrorListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  //  System.err.println("Notifying text listeners "
  //         +"(ClassifierPerformanceEvaluator)");
  ((VisualizableErrorListener)l.elementAt(i)).acceptDataSet(re);
      }
    }
  }
View Full Code Here

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

    Vector newVector = new Vector(1);
    Enumeration enu = super.listOptions();
    while (enu.hasMoreElements()) {
      newVector.addElement(enu.nextElement());
    }

    newVector.addElement(new Option(
              "\tName of a directory to search for cost files when loading\n"
              +"\tcosts on demand (default current directory).",
              "D", 1, "-D <directory>"));

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

         String replyCode = line.substring(0, 3);
         StringBuffer reply = new StringBuffer("");
         if (line.length() > 3)
             reply.append(line.substring(4));
                 
         Vector dataLines = null;

         // check for multi-line response and build up
         // the reply
         if (line.length() > 3 && line.charAt(3) == '-') {
             dataLines = new Vector();
            
             // if first line has data, add to data list
             if (line.length() > 4) {
                 line = line.substring(4).trim();
                 if (line.length() > 0)
                     dataLines.addElement(line);
             }
            
             boolean complete = false;
             while (!complete) {
                
                 line = readLine();
                 if (line == null){
                     String msg = "Control channel unexpectedly closed";
                     log.error(msg);
                     throw new ControlChannelIOException(msg);
                 }
                                 
                 if (line.length() == 0)
                     continue;
                
                 log(line, false);
                
                 if (line.length() > 3 &&
                         line.substring(0, 3).equals(replyCode) &&
                         line.charAt(3) == ' ') {
                     line = line.substring(3).trim(); // get rid of the code
                     if (line.length() > 0) {
                         if (reply.length() > 0)
                             reply.append(" ");
                         reply.append(line);
                         dataLines.addElement(line);
                     }
                     complete = true;
                 }
                 else { // not the last line
                     reply.append(" ").append(line);
                     dataLines.addElement(line);
                 }
             } // end while
         } // end if
        
         if (dataLines != null) {
             String[] data = new String[dataLines.size()];
             dataLines.copyInto(data);
             return new FTPReply(replyCode, reply.toString(), data);
         }
         else {
             return new FTPReply(replyCode, reply.toString());
         }
View Full Code Here

   
    // don't do anything if the thread that we've been running in has been interrupted
    if (Thread.currentThread().isInterrupted()) {
      return;
    }
    Vector l;
    synchronized (this) {
      l = (Vector)m_batchClassifierListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  ((BatchClassifierListener)l.elementAt(i)).acceptClassifier(ce);
      }
    }
  }
View Full Code Here

   * Notify all graph listeners of a graph event
   *
   * @param ge a <code>GraphEvent</code> value
   */
  private void notifyGraphListeners(GraphEvent ge) {
    Vector l;
    synchronized (this) {
      l = (Vector)m_graphListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  ((GraphListener)l.elementAt(i)).acceptGraph(ge);
      }
    }
  }
View Full Code Here

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

    Vector newVector = new Vector(4);

    newVector.addElement(new Option(
       "\tThe full class name of the classifier.\n"
        +"\teg: weka.classifiers.bayes.NaiveBayes",
       "W", 1,
       "-W <class name>"));
    newVector.addElement(new Option(
       "\tThe index of the class for which IR statistics\n" +
       "\tare to be output. (default 1)",
       "C", 1,
       "-C <index>"));
    newVector.addElement(new Option(
       "\tThe index of an attribute to output in the\n" +
       "\tresults. This attribute should identify an\n" +
             "\tinstance in order to know which instances are\n" +
             "\tin the test set of a cross validation. if 0\n" +
             "\tno output (default 0).",
       "I", 1,
       "-I <index>"));
    newVector.addElement(new Option(
       "\tAdd target and prediction columns to the result\n" +
             "\tfor each fold.",
       "P", 0,
       "-P"));

    if ((m_Template != null) &&
  (m_Template instanceof OptionHandler)) {
      newVector.addElement(new Option(
       "",
       "", 0, "\nOptions specific to classifier "
       + m_Template.getClass().getName() + ":"));
      Enumeration enu = ((OptionHandler)m_Template).listOptions();
      while (enu.hasMoreElements()) {
  newVector.addElement(enu.nextElement());
      }
    }
    return newVector.elements();
  }
View Full Code Here

   * Notify all text listeners of a text event
   *
   * @param ge a <code>TextEvent</code> value
   */
  private void notifyTextListeners(TextEvent ge) {
    Vector l;
    synchronized (this) {
      l = (Vector)m_textListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  ((TextListener)l.elementAt(i)).acceptText(ge);
      }
    }
  }
View Full Code Here

    // don't do anything if the thread that we've been running in has been interrupted
    if (Thread.currentThread().isInterrupted()) {
      return;
    }
   
    Vector l;
    synchronized (this) {
      l = (Vector)m_incrementalClassifierListeners.clone();
    }
    if (l.size() > 0) {
      for(int i = 0; i < l.size(); i++) {
  ((IncrementalClassifierListener)l.elementAt(i)).acceptClassifier(ce);
      }
    }
  }
View Full Code Here

TOP

Related Classes of java.util.Vector$Itr

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.