Package weka.core

Examples of weka.core.SerializedObject


   * @throws Exception  if setup fails
   */
  protected Object setup(Object original, double valueX, double valueY) throws Exception {
    Object  result;
   
    result = new SerializedObject(original).getObject();
   
    if (original instanceof Classifier) {
      if (getXProperty().startsWith(PREFIX_CLASSIFIER))
  setValue(
      result,
View Full Code Here


   * @param model   the filter to copy
   * @return     a deep copy of the filter
   * @throws Exception   if an error occurs
   */
  public static Filter makeCopy(Filter model) throws Exception {
    return (Filter)new SerializedObject(model).getObject();
  }
View Full Code Here

    if (model == null) {
      throw new Exception("No model filter set");
    }
    Filter[] filters = new Filter[num];
    SerializedObject so = new SerializedObject(model);
    for (int i = 0; i < filters.length; i++) {
      filters[i] = (Filter) so.getObject();
    }
    return filters;
  }
View Full Code Here

        break;
      }
    }
   
    if (match != null) {
      SerializedObject so = new SerializedObject(match, false);
      copy = (DefineFunction)so.getObject();
      //System.err.println(copy);
    }
   
    return copy;
  }
View Full Code Here

  System.err.println(Messages.getInstance().getString("RunPanel_ExperimentRunner_Error_Text_First"));
      } else {
  System.err.println(Messages.getInstance().getString("RunPanel_ExperimentRunner_Error_Text_Second") + exp.toString());
      }
      System.err.println(Messages.getInstance().getString("RunPanel_ExperimentRunner_Error_Text_Third"));
      SerializedObject so = new SerializedObject(exp);
      System.err.println(Messages.getInstance().getString("RunPanel_ExperimentRunner_Error_Text_Fourth"));
      m_ExpCopy = (Experiment) so.getObject();
      System.err.println(Messages.getInstance().getString("RunPanel_ExperimentRunner_Error_Text_Fifth"));
    }
View Full Code Here

   */
  protected Object copyObject(Object source) {
   
    Object result = null;
    try {
      SerializedObject so = new SerializedObject(source);
      result = so.getObject();
    } catch (Exception ex) {
      System.err.println(Messages.getInstance().getString("AlgorithmListPanel_CopyObject_Error_Text"));
      System.err.println(ex);
    }
    return result;
View Full Code Here

    if (model == null) {
      throw new Exception("No model evaluator set");
    }
    ASEvaluation [] evaluators = new ASEvaluation [num];
    SerializedObject so = new SerializedObject(model);
    for(int i = 0; i < evaluators.length; i++) {
      evaluators[i] = (ASEvaluation) so.getObject();
    }
    return evaluators;
  }
View Full Code Here

  protected Object[] makeCopies(Object obj, int num) throws Exception {
    if (obj == null)
      throw new Exception("No object set");

    Object[] objs = new Object[num];
    SerializedObject so = new SerializedObject(obj);
    for(int i = 0; i < objs.length; i++) {
      objs[i] = so.getObject();
    }
   
    return objs;
  }
View Full Code Here

    // copy the bean via serialization
    ((Visible)bean).getVisual().removePropertyChangeListener(this);
    bean.removePropertyChangeListenersSubFlow(this);
    Object copy = null;
    try {
      SerializedObject so = new SerializedObject(bean);
      copy = (MetaBean)so.getObject();
    } catch (Exception ex) {
      ex.printStackTrace();
      return null;
    }
    ((Visible)bean).getVisual().addPropertyChangeListener(this);
View Full Code Here

                  m_toolBars.removeTabAt(m_toolBars.getTabCount() - 1);
                  m_userToolBar = null;
                  notifyIsDirty();
                }
              } else {
                SerializedObject so = new SerializedObject(tempBN);
                MetaBean copy = (MetaBean)so.getObject();
                /*((Visible)copy).getVisual().
                  addPropertyChangeListener(KnowledgeFlowApp.this); */
                copy.addPropertyChangeListenersSubFlow(KnowledgeFlowApp.this);
                m_toolBarBean = copy;
              }
View Full Code Here

TOP

Related Classes of weka.core.SerializedObject

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.