Package weka.gui.beans

Examples of weka.gui.beans.Associator


          saver.waitUntilFinish();     
       
       
        if(savers.size() == 0) {
          for(int i = 0; i < associators.size(); i++) {
            Associator associator = (Associator)associators.get(i);
            logger.debug("Start blocking on: " + associator );     
            associator.waitUntilFinish();     
         
        }
      }
     
     
View Full Code Here


 
  public void setupAssociators() {
    logger.debug("IN");
    env.setParameter("operation-output", env.getOutputFile());
    for(int i = 0; i < associators.size(); i++) {
      Associator associator = (Associator)associators.get(i);
      TextListener listener = new TextListener() {
        public void acceptText(TextEvent e) {
          try {
            synchronized(this) {
             
              Writer writer = new FileWriter(env.getOutputFile(), true);
              writer.write( e.getText().replaceAll("\n", "\r\n"));             
              writer.flush();
              writer.close();
              /*
              FileOutputStream outputStream = new FileOutputStream(env.getOutputFile(), true);
              //outputStream.write(e.getText().getBytes("US-ASCII"));
              outputStream.write(e.getText().getBytes("UTF-8"));
              outputStream.flush();
              outputStream.close();
              */
            }
          } catch (Throwable t) {
            logger.error(t);
            throw new RuntimeException("Impossible to save output text on file [" + env.getOutputFile() + "]", t);
          }
        }
      };
      associator.addTextListener(listener);
    }
   
    logger.debug("OUT");
  }
View Full Code Here

TOP

Related Classes of weka.gui.beans.Associator

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.