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

📄 schema.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.Multidimensional;

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

/**
 * Schema contains all elements comprising a Multidimensional database.
 */
public class Schema extends com.prudsys.pdm.Cwm.Core.Package implements org.omg.cwm.resource.multidimensional.Schema
{
   public DimensionedObject[] dimensionedObject;  // changed to array by M. Thess
   public Dimension[] dimension; // changed to array by M. Thess

   public Schema()
   {

   }

   public Collection getDimension() {
     return com.prudsys.pdm.Cwm.Core.CWMTools.ArrayToList(dimension);
   }

   public void setDimension(Collection dimension) {

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

   public void addDimension( org.omg.cwm.resource.multidimensional.Dimension input) {

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

   public void removeDimension( org.omg.cwm.resource.multidimensional.Dimension input) {

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

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

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

   public Collection getDimensionedObject() {
     return com.prudsys.pdm.Cwm.Core.CWMTools.ArrayToList(dimensionedObject);
   }

   public void setDimensionedObject(Collection dimensionedObject) {

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

   public void addDimensionedObject( org.omg.cwm.resource.multidimensional.DimensionedObject input) {

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

   public void removeDimensionedObject( org.omg.cwm.resource.multidimensional.DimensionedObject input) {

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

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

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

}

⌨️ 快捷键说明

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