📄 package.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 package is a grouping of model elements.
*
*
*
* In the metamodel, Package is a subclass of Namespace. A Package contains
* ModelElements such as Packages and Classifiers. A Package may also contain
* Constraints and Dependencies between ModelElements of the Package.
*
*
*
* The purpose of the package construct is to provide a general grouping
* mechanism. In fact, its only semantics is to define a namespace for its
* contents. The package construct can be used for organizing elements for any
* purpose; the criteria to use for grouping elements together into one package
* are not defined.
*
*
*
* A package owns a set of model elements, with the implication that if the
* package is removed from the model, so are the elements owned by the package.
* Elements with names, such as classifiers, that are owned by the same package
* must have unique names within the package, although elements in different
* packages may have the same name.
*
*
*
* There may be relationships between elements contained in the same package, and
* between an element in one package and an element in a surrounding package at
* any level. In other words, elements ?see? all the way out through nested levels
* of packages.
*
*
*
* Elements in peer packages, however, are encapsulated and are not a priori
* visible to each other. The same goes for elements in contained packages, i.e.
* packages do not see "inwards".
*
*
*
* Elements owned by a Package can be made available to other Packages by importing
*
* them. Although any ModelElement may be imported by a Package, imported
*
* ModelElements are typically other Packages. When an element is imported by a
*
* package it extends the namespace of that package. Thus the elements available
* in a
*
* Package consists of its owned and imported ModelElements.
*/
public class Package extends Namespace implements org.omg.cwm.objectmodel.core.Package
{
public ModelElement importedElement[];
/**
* @roseuid 3C5E911C01E4
*/
public Package()
{
}
public Collection getImportedElement() {
return CWMTools.ArrayToList(importedElement);
}
public void setImportedElement(Collection importedElement) {
this.importedElement = new ModelElement[ importedElement.size() ];
Iterator it = importedElement.iterator();
for (int i = 0; i < importedElement.size(); i++)
this.importedElement[i] = (ModelElement) it.next();
}
public void addImportedElement( org.omg.cwm.objectmodel.core.ModelElement input) {
int size = (importedElement == null) ? 0 : importedElement.length;
ModelElement[] oldData = importedElement;
importedElement = new ModelElement[size+1];
if (size > 0) System.arraycopy(oldData, 0, importedElement, 0, size);
importedElement[size] = (ModelElement) input;
}
public void removeImportedElement( org.omg.cwm.objectmodel.core.ModelElement input) {
int size = (importedElement == null) ? 0 : importedElement.length;
if (size == 0)
return;
int ipos = -1;
for (int i = 0; i < size; i++)
if (importedElement[i].equals(input)) {
ipos = i;
break;
}
if (ipos == -1)
return;
ModelElement[] oldData = importedElement;
importedElement = new ModelElement[size-1];
for (int i = 0; i < ipos; i++)
importedElement[i] = oldData[i];
for (int i = ipos+1; i < size; i++)
importedElement[i-1] = oldData[i];
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -