⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dependency.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
字号:
/*
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 2 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software
 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

 /**
  * Title: XELOPES Data Mining Library
  * Description: The XELOPES library is an open platform-independent and data-source-independent library for Embedded Data Mining.
  * Copyright: Copyright (c) 2002 Prudential Systems Software GmbH
  * Company: ZSoft (www.zsoft.ru), Prudsys (www.prudsys.com)
  * @author Valentine Stepanenko (valentine.stepanenko@zsoft.ru)
  * @version 1.0
  */

package com.prudsys.pdm.Cwm.Core;

import java.util.Collection;
import java.util.Iterator;


/**
 * A dependency states that the implementation or functioning of one or more
 * elements requires the presence of one or more other elements.
 *
 *
 *
 * In the metamodel, a Dependency is a directed relationship from a client (or
 * clients) to a supplier (or suppliers) stating that the client is dependent on
 * the supplier (i.e., the client element requires the presence and knowledge of
 * the supplier element).
 *
 *
 *
 * A dependency specifies that the semantics of a set of model elements requires
 * the presence of another set of model elements. This implies that if the source
 * is somehow modified, the dependents probably must be modified. The reason for
 * the dependency can be specified in several different ways (e.g., using natural
 * language or an algorithm) but is often implicit.
 *
 *
 *
 * Whenever the supplier element of a dependency changes, the client element is
 * potentially invalidated. After such invalidation, a check should be performed
 * followed by possible changes to the derived client element. Such a check should
 * be performed after which action can be taken to change the derived element to
 * validate it again.
 */
public class Dependency extends ModelElement implements org.omg.cwm.objectmodel.core.Dependency
{

   /**
    * Contains a description of the nature of the dependency relationship between the
    * client and supplier. The list of possible values is open-ended. However, CWM
    * predefines the values "Abstraction" and "Usage".
    */
   public String kind;
   public ModelElement client[];
   public ModelElement supplier[];

   /**
    * @roseuid 3C5E809D0387
    */
   public Dependency()
   {

   }

   public java.lang.String getKind() {

     return kind.getString();
   }

   public void setKind(java.lang.String kind) {

     String s = new String();
     s.setString(kind);
     this.kind = s;
   }

   public Collection getClient() {

     return CWMTools.ArrayToList(client);
   }

   public void setClient(Collection client) {

     this.client = new ModelElement[ client.size() ];
     Iterator it = client.iterator();
     for (int i = 0; i < client.size(); i++)
       this.client[i] = (ModelElement) it.next();
   }

   public void addClient( org.omg.cwm.objectmodel.core.ModelElement input) {

     int size = (client == null) ? 0 : client.length;
     ModelElement[] oldData = client;
     client = new ModelElement[size+1];
     if (size > 0) System.arraycopy(oldData, 0, client, 0, size);
     client[size] = (ModelElement) input;
   }

   public void removeClient( org.omg.cwm.objectmodel.core.ModelElement input) {

     int size = (client == null) ? 0 : client.length;
     if (size == 0)
       return;

     int ipos = -1;
     for (int i = 0; i < size; i++)
       if (client[i].equals(input)) {
         ipos = i;
         break;
       }
     if (ipos == -1)
       return;

     ModelElement[] oldData = client;
     client = new ModelElement[size-1];
     for (int i = 0; i < ipos; i++)
       client[i] = oldData[i];
     for (int i = ipos+1; i < size; i++)
       client[i-1] = oldData[i];
   }

   public Collection getSupplier() {

     return CWMTools.ArrayToList(supplier);
   }

   public void setSupplier(Collection supplier) {

     this.supplier = new ModelElement[ supplier.size() ];
     Iterator it = supplier.iterator();
     for (int i = 0; i < supplier.size(); i++)
       this.supplier[i] = (ModelElement) it.next();
   }

   public void addSupplier(org.omg.cwm.objectmodel.core.ModelElement input) {

     int size = (supplier == null) ? 0 : supplier.length;
     ModelElement[] oldData = supplier;
     supplier = new ModelElement[size+1];
     if (size > 0) System.arraycopy(oldData, 0, supplier, 0, size);
     supplier[size] = (ModelElement) input;
   }

   public void removeSupplier(org.omg.cwm.objectmodel.core.ModelElement input) {

     int size = (supplier == null) ? 0 : supplier.length;
     if (size == 0)
       return;

     int ipos = -1;
     for (int i = 0; i < size; i++)
       if (supplier[i].equals(input)) {
         ipos = i;
         break;
       }
     if (ipos == -1)
       return;

     ModelElement[] oldData = supplier;
     supplier = new ModelElement[size-1];
     for (int i = 0; i < ipos; i++)
       supplier[i] = oldData[i];
     for (int i = ipos+1; i < size; i++)
       supplier[i-1] = oldData[i];
   }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -