Package weka.core

Examples of weka.core.SerializedObject


    double[][] m_P;

    SetDistributionAction(int nTargetNode, double[][] P) {
      try {
        m_nTargetNode = nTargetNode;
        SerializedObject so = new SerializedObject(m_Distributions[nTargetNode]);
        m_CPT = (Estimator[]) so.getObject();
        ;
        m_P = P;
      } catch (Exception e) {
        e.printStackTrace();
      }
View Full Code Here


      }
    } // c'tor

    public void undo() {
      try {
        SerializedObject so = new SerializedObject(m_CPT);
        m_Distributions[m_nTargetNode] = (Estimator[]) so.getObject();
      } catch (Exception e) {
        e.printStackTrace();
      }
    } // undo
View Full Code Here

    DelValueAction(int nTargetNode, String sValue) {
      try {
        m_nTargetNode = nTargetNode;
        m_sValue = sValue;
        m_att = m_Instances.attribute(nTargetNode);
        SerializedObject so = new SerializedObject(m_Distributions[nTargetNode]);
        m_CPT = (Estimator[]) so.getObject();
        ;
        m_children = new FastVector();
        for (int iNode = 0; iNode < getNrOfNodes(); iNode++) {
          if (m_ParentSets[iNode].contains(nTargetNode)) {
            m_children.addElement(iNode);
View Full Code Here

    } // c'tor

    public void undo() {
      try {
        m_Instances.insertAttributeAt(m_att, m_nTargetNode);
        SerializedObject so = new SerializedObject(m_CPT);
        m_Distributions[m_nTargetNode] = (Estimator[]) so.getObject();
        for (int iChild = 0; iChild < m_children.size(); iChild++) {
          int nChild = (Integer) m_children.elementAt(iChild);
          m_Instances.insertAttributeAt(m_att, m_nTargetNode);
          so = new SerializedObject(m_childAtts[iChild]);
          m_Distributions[nChild] = (Estimator[]) so.getObject();
        }
      } catch (Exception e) {
        e.printStackTrace();
      }
    } // undo
View Full Code Here

      Vector metaDetails = new Vector();
      metaDetails.add(displayName);
      metaDetails.add(serialized);
      metaDetails.add(scaledIcon);
      SerializedObject so = new SerializedObject(metaDetails);
      Vector copy = (Vector)so.getObject();

      JTreeLeafDetails metaLeaf = new JTreeLeafDetails(displayName, copy, scaledIcon);


      DefaultMutableTreeNode newUserComp = new DefaultMutableTreeNode(metaLeaf);
View Full Code Here

    m_beanLayout.removeAll();
    BeanInstance.init();
    BeanConnection.init();


    SerializedObject so = new SerializedObject(v);
    Vector copy = (Vector)so.getObject();

    Vector beans = (Vector)copy.elementAt(0);
    Vector connections = (Vector)copy.elementAt(1);

    // reset environment variables
View Full Code Here

      BeanConnection.getConnections(m_mainKFPerspective.getCurrentTabIndex());
    detachFromLayout(beans);
    v.add(beans);
    v.add(connections);

    SerializedObject so = new SerializedObject(v);
    Vector copy = (Vector)so.getObject();

    //    tempWrite(beans, connections);

    integrateFlow(beans, connections, true, false);
    return copy;
View Full Code Here

          if (toEdit == null) {
            System.err.println("Oh oh, couldn't find " + fieldName + " to edit!");
          } else {
            // now make a copy of it
            try {
              SerializedObject so = new SerializedObject(toEdit);
              toEdit = (ArrayList<CustomPeriodicTest>)so.getObject();
             
              String newFieldName = displayAddEditDialog(toEdit, fieldName);
              if (newFieldName.length() == 0) {
                // cancel selected so do nothing
              } else if (!newFieldName.equals(fieldName)) {
View Full Code Here

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

    DeleteNodeAction(int nTargetNode) {
      m_nTargetNode = nTargetNode;
      m_att = m_Instances.attribute(nTargetNode);
      try {
        SerializedObject so = new SerializedObject(m_Distributions[nTargetNode]);
        m_CPT = (Estimator[]) so.getObject();
        ;
        so = new SerializedObject(m_ParentSets[nTargetNode]);
        m_ParentSet = (ParentSet) so.getObject();
      } catch (Exception e) {
        e.printStackTrace();
      }
      m_deleteArcActions = new FastVector();
      for (int iNode = 0; iNode < getNrOfNodes(); iNode++) {
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.