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

📄 sparsegridmodel.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
	 * If you pass in a null value to this method, the AttributeLevels object is
	 * cleared and will not be marshaled.
	 * @param text	New text.
	 */
	public void setAttributeLevelsText(String text)
	{
		if( text == null )
		{
			this._objAttributeLevels = null;
			return;
		}

		if( this._objAttributeLevels == null )
			this._objAttributeLevels = new AttributeLevels();

		this._objAttributeLevels.setText(text);
		this._objAttributeLevels._setParent(this);
	}

	/**
	 * Gets AttributeLevels object.
	 */
	public AttributeLevels getAttributeLevels()
	{
		return _objAttributeLevels;
	}

	/**
	 * Replaces the existing AttributeLevels object with a new object.
	 * If you pass in a null value to this method, the AttributeLevels object is
	 * cleared and will not be marshaled.
	 * @param obj	New object.
	 */
	public void setAttributeLevels(AttributeLevels obj)
	{
		this._objAttributeLevels = obj;
		if( obj == null )
            return;

		obj._setParent(this);
	}
	/**
	 * Returns an array of SparseGrid objects. The length of the returned
	 * array is zero if the list of SparseGrid object is empty.
	 */
	public SparseGrid[] getSparseGrid()
	{
		return (SparseGrid[])_objSparseGrid.toArray(new SparseGrid[0]);
	}

	/**
	 * Replaces all existing SparseGrid objects with a new array of
	 * SparseGrid objects.
	 * @param objArray	an array of SparseGrid objects.
	 */
	public void setSparseGrid(SparseGrid[] objArray)
	{
		if( objArray == null || objArray.length == 0 )
			this._objSparseGrid.clear();
		else
		{
			this._objSparseGrid = new ArrayList(Arrays.asList(objArray));
			for( int i=0; i<objArray.length; i++ )
			{
				if( objArray[i] != null )
					objArray[i]._setParent(this);
			}
		}
	}

	/**
	 * Gets the SparseGrid object at the specified index.
	 * @param index	index of the returned object.
	 * @throws IndexOutOfBoundsException	if index is out of range.
	 */
	public SparseGrid getSparseGrid(int index)
	{
		return (SparseGrid)_objSparseGrid.get(index);
	}

	/**
	 * Replaces an existing SparseGrid object at the specified index with
	 * a new SparseGrid object.
	 * @param index	index of replaced object.
	 * @throws IndexOutOfBoundsException	if index is out of range.
	 */
	public void setSparseGrid(int index, SparseGrid obj)
	{
		if( obj == null )
			removeSparseGrid(index);
		else
		{
			_objSparseGrid.set(index, obj);
			obj._setParent(this);
		}
	}

	/**
	 * Returns the number of SparseGrid objects in the list.
	 */
	public int getSparseGridCount()
	{
		return _objSparseGrid.size();
	}

	/**
	 * Returns <code>true</code> if there is no SparseGrid object in the list; otherwise,
	 * the method returns <code>false</code>.
	 */
	public boolean isNoSparseGrid()
	{
		return _objSparseGrid.size() == 0;
	}

	/**
	 * Returns a read-only list of SparseGrid objects.
	 */
	public List getSparseGridList()
	{
		return Collections.unmodifiableList(_objSparseGrid);
	}

	/**
	 * Adds a new SparseGrid object at the end of the list.
	 * @return <code>true</code> if the new object is added to the list; otherwise,
	 * the method returns <code>false</code>.
	 */
	public boolean addSparseGrid(SparseGrid obj)
	{
		if( obj==null )
			return false;

		obj._setParent(this);
		return _objSparseGrid.add(obj);
	}

	/**
	 * Adds a list of new SparseGrid objects at the end of the list.
	 * @return <code>true</code> if the list was changed; otherwise, the method
	 * returns <code>false</code>.
	 */
	public boolean addSparseGrid(Collection coSparseGrid)
	{
		if( coSparseGrid==null )
			return false;

		java.util.Iterator it = coSparseGrid.iterator();
		while( it.hasNext() )
		{
			Object obj = it.next();
			if( obj != null && obj instanceof com.borland.xml.toolkit.XmlObject )
				((com.borland.xml.toolkit.XmlObject)obj)._setParent(this);
		}
		return _objSparseGrid.addAll(coSparseGrid);
	}

	/**
	 * Removes an existing SparseGrid object at the specified index.
	 * @return	The removed object.
	 */
	public SparseGrid removeSparseGrid(int index)
	{
		return (SparseGrid)_objSparseGrid.remove(index);
	}

	/**
	 * Removes the specified SparseGrid object.
	 * @return <code>true</code> if this list contains the object; otherwise,
	 * the method returns <code>false</code>.
	 */
	public boolean removeSparseGrid(SparseGrid obj)
	{
		return _objSparseGrid.remove(obj);
	}

	/**
	 * Clears all SparseGrid objects from the list.
	 */
	public void clearSparseGridList()
	{
		_objSparseGrid.clear();
	}

	/**
	 * Marshals this object to an element.
	 */
	public com.borland.xml.toolkit.Element marshal()
	{
		com.borland.xml.toolkit.Element elem = new com.borland.xml.toolkit.Element(get_TagName());
		/** Marshals "modelName" attribute */
		elem.addAttribute(modelName.marshal());
		/** Marshals "useCoarseGrid" attribute */
		elem.addAttribute(useCoarseGrid.marshal());
		/** Marshals "basis_degree" attribute */
		elem.addAttribute(basis_degree.marshal());
		/** Marshals "isWaveletBasis" attribute */
		elem.addAttribute(isWaveletBasis.marshal());
		/** Marshals "algorithmName" attribute */
		elem.addAttribute(algorithmName.marshal());
		/** Marshals "sg_type" attribute */
		elem.addAttribute(sg_type.marshal());
		/** Marshals "functionName" attribute */
		elem.addAttribute(functionName.marshal());
		/** Marshals "level" attribute */
		elem.addAttribute(level.marshal());
		/** Marshals a list of Extension objects to elements */
		Iterator it1 = _objExtension.iterator();
		while( it1.hasNext() )
		{
			Extension obj = (Extension)it1.next();
			if( obj != null )
				elem.addContent(obj.marshal());
		}
		/** Marshals a MiningSchema object to an element */
		if( _objMiningSchema != null )
			elem.addContent(_objMiningSchema.marshal());
		/** Marshals a ModelStats object to an element */
		if( _objModelStats != null )
			elem.addContent(_objModelStats.marshal());
		/** Marshals a AttributeLevels object to an element */
		if( _objAttributeLevels != null )
			elem.addContent(_objAttributeLevels.marshal());
		/** Marshals a list of SparseGrid objects to elements */
		Iterator it2 = _objSparseGrid.iterator();
		while( it2.hasNext() )
		{
			SparseGrid obj = (SparseGrid)it2.next();
			if( obj != null )
				elem.addContent(obj.marshal());
		}

		return elem;
	}

	/**
	 * Unmarshals the specified "SparseGridModel" element back to a SparseGridModel object.
	 */
	public static SparseGridModel unmarshal(com.borland.xml.toolkit.Element elem)
	{
		if( elem == null )
			return null;

		SparseGridModel __objSparseGridModel = new SparseGridModel();
		if( __objSparseGridModel != null ) //found the element?
		{
			/** Unmarshals "modelName" attribute */
			__objSparseGridModel.modelName.setValue(elem.getAttribute("modelName"));
			/** Unmarshals "useCoarseGrid" attribute */
			__objSparseGridModel.useCoarseGrid.setValue(elem.getAttribute("useCoarseGrid"));
			/** Unmarshals "basis_degree" attribute */
			__objSparseGridModel.basis_degree.setValue(elem.getAttribute("basis_degree"));
			/** Unmarshals "isWaveletBasis" attribute */
			__objSparseGridModel.isWaveletBasis.setValue(elem.getAttribute("isWaveletBasis"));
			/** Unmarshals "algorithmName" attribute */
			__objSparseGridModel.algorithmName.setValue(elem.getAttribute("algorithmName"));
			/** Unmarshals "sg_type" attribute */
			__objSparseGridModel.sg_type.setValue(elem.getAttribute("sg_type"));
			/** Unmarshals "functionName" attribute */
			__objSparseGridModel.functionName.setValue(elem.getAttribute("functionName"));
			/** Unmarshals "level" attribute */
			__objSparseGridModel.level.setValue(elem.getAttribute("level"));
		}
		/** Unmarshals a list of "<<_tagName_>>" elements back to Extension objects. */
		Iterator it1 = elem.getChildren(Extension._tagName).iterator();
		while( it1.hasNext() )
			__objSparseGridModel.addExtension(Extension.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
		/** Unmarshals an element back to a MiningSchema object */
		__objSparseGridModel.setMiningSchema(MiningSchema.unmarshal(elem.getChild(MiningSchema._tagName)));
		/** Unmarshals an element back to a ModelStats object */
		__objSparseGridModel.setModelStats(ModelStats.unmarshal(elem.getChild(ModelStats._tagName)));
		/** Unmarshals an element back to a AttributeLevels object */
		__objSparseGridModel.setAttributeLevels(AttributeLevels.unmarshal(elem.getChild(AttributeLevels._tagName)));
		/** Unmarshals a list of "<<_tagName_>>" elements back to SparseGrid objects. */
		Iterator it2 = elem.getChildren(SparseGrid._tagName).iterator();
		while( it2.hasNext() )
			__objSparseGridModel.addSparseGrid(SparseGrid.unmarshal((com.borland.xml.toolkit.Element)it2.next()));

		return __objSparseGridModel;
	}

	/**
	 * Validates this object. If you pass <code>true</code> to this method, it
	 * checks for the first error and stops. On the other hand, if you pass
	 * <code>false</code> to this method, it collects all the errors by
	 * visiting every available elements.
	 * @param firstError	<code>true</code> to exit this method when the first error
	 * is found; <code>false</code> to collect all errors.
	 * @return com.borland.xml.toolkit.ErrorList	A list that contains one or more errors.
	 * @see com.borland.xml.toolkit.XmlObject#validate()
	 * @see com.borland.xml.toolkit.XmlObject#isValid()
	 * @see com.borland.xml.toolkit.ErrorList
	 */
	public com.borland.xml.toolkit.ErrorList validate(boolean firstError)
	{
		com.borland.xml.toolkit.ErrorList errors = new com.borland.xml.toolkit.ErrorList();

		/** Extension is zero or more */
		Iterator it1 = _objExtension.iterator();
		while( it1.hasNext() )
		{
			Extension obj = (Extension)it1.next();
			if( obj != null )
			{
				errors.add(obj.validate(firstError));
				if( firstError && errors.size() > 0 )
					return errors;
			}
		}
		/** MiningSchema is mandatory */
		if( _objMiningSchema != null )
			errors.add(_objMiningSchema.validate(firstError));
		else
			errors.add(new com.borland.xml.toolkit.ElementError(this, MiningSchema.class));
		if( firstError && errors.size() > 0 )
			return errors;
		/** ModelStats is optional */
		if( _objModelStats != null )
		{
			errors.add(_objModelStats.validate(firstError));
			if( firstError && errors.size() > 0 )
				return errors;
		}
		/** AttributeLevels is optional */
		if( _objAttributeLevels != null )
		{
			errors.add(_objAttributeLevels.validate(firstError));
			if( firstError && errors.size() > 0 )
				return errors;
		}
		/** SparseGrid is one or more */
		if( _objSparseGrid.size() == 0 )
		{
			errors.add(new com.borland.xml.toolkit.ElementError(this, SparseGrid.class));
			if( firstError )
				return errors;
		}
		else
		{
			Iterator it2 = _objSparseGrid.iterator();
			while( it2.hasNext() )
			{
				SparseGrid obj = (SparseGrid)it2.next();
				if( obj != null )
				{
					errors.add(obj.validate(firstError));
					if( firstError && errors.size() > 0 )
						return errors;
				}
			}
		}

		return errors.size()==0 ? null : errors;
	}

	/**
	 * Returns a list containing all child elements. Each element in the list is a subclass
	 * of XmlObject.
	 */
	public java.util.List _getChildren()
	{
		java.util.List children = new java.util.ArrayList();
		/** adds _objExtension */
		if( _objExtension != null && _objExtension.size() > 0 )
			children.add(_objExtension);
		/** adds _objMiningSchema */
		if( _objMiningSchema != null )
			children.add(_objMiningSchema);
		/** adds _objModelStats */
		if( _objModelStats != null )
			children.add(_objModelStats);
		/** adds _objAttributeLevels */
		if( _objAttributeLevels != null )
			children.add(_objAttributeLevels);
		/** adds _objSparseGrid */
		if( _objSparseGrid != null && _objSparseGrid.size() > 0 )
			children.add(_objSparseGrid);
		return children;
	}


	/**
	 * Gets the tag name of this element.
	 */
	public String get_TagName()
	{
		return _tagName;
	}
}

⌨️ 快捷键说明

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