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

📄 modelelement.java

📁 为了下东西 随便发了个 datamining 的源代码
💻 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 model element is an element that is an abstraction drawn from the system
 * being modeled.
 *
 *
 *
 * In the metamodel, a ModelElement is a named entity in a Model. It is the base
 * for all modeling metaclasses in the CWM. All other modeling metaclasses are
 * either direct or indirect subclasses of ModelElement.
 */
public abstract class ModelElement extends Element implements org.omg.cwm.objectmodel.core.ModelElement
{

   /**
    * An identifier for the ModelElement within its containing Namespace.
    */
   public Name name = new Name();

   /**
    * Specifies extent of the visibility of the ModelElement within its owning
    * Namespace.
    */
   public VisibilityKind visibility;

   public Dependency clientDependency[];
   public Dependency supplierDependency[];
   public Constraint constraint[];
   public Namespace namespace;
   public Package importer[];
   public Stereotype stereotype;
   public TaggedValue taggedValue[];

   /**
    * @roseuid 3C5E9664012A
    */
   public ModelElement()
   {

   }

   public java.lang.String getName() {

     return name.getString();
   }

   public void setName(java.lang.String name) {

     Name n = new Name();
     n.setString(name);
     this.name = n;
   }

   public java.lang.String getVisibility() {

     return visibility.getString();
   }

   public void setVisibility(java.lang.String visibility) {

     VisibilityKind vk = new VisibilityKind();
     vk.setString(visibility);
     this.visibility = vk;
   }

   public Collection getClientDependency() {

     return CWMTools.ArrayToList(clientDependency);
   }

   public void setClientDependency(Collection clientDependency) {

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

   public void addClientDependency( org.omg.cwm.objectmodel.core.Dependency input) {

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

   public void removeClientDependency( org.omg.cwm.objectmodel.core.Dependency input) {

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

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

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

   public Collection getConstraint() {

     return CWMTools.ArrayToList(constraint);
   }

   public void setConstraint(Collection constraint) {

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

   public void addConstraint(org.omg.cwm.objectmodel.core.Constraint input) {

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

   public void removeConstraint(org.omg.cwm.objectmodel.core.Constraint input)  {

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

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

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

   public Collection getImporter() {

     return CWMTools.ArrayToList(importer);
   }

   public void setImporter(Collection importer) {

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

   public void addImporter(org.omg.cwm.objectmodel.core.Package input) {

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

   public void removeImporter(org.omg.cwm.objectmodel.core.Package input) {

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

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

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

   public org.omg.cwm.objectmodel.core.Namespace getNamespace() {

     return namespace;
   }

   public void setNamespace(org.omg.cwm.objectmodel.core.Namespace namespace) {

     this.namespace = (Namespace) namespace;
   }
}

⌨️ 快捷键说明

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