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

📄 miningalgorithms.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
字号:
/**
 * This file is generated by BorlandXML.
 */

package com.prudsys.pdm.Utils.AlgorithmSpecification;

import java.util.*;

/**
 * The MiningAlgorithms class represents the element "MiningAlgorithms" with the content
 * model defined as follows:
 * <p>
 * &lt;!ELEMENT MiningAlgorithms (AlgorithmSpecification)*&gt;<br>
 */
public class MiningAlgorithms extends com.borland.xml.toolkit.XmlObject
{
	/** xml tag name of this element. */
	public static String _tagName = "MiningAlgorithms";
	/** Defines a list of AlgorithmSpecification objects. */
	protected ArrayList _objAlgorithmSpecification = new ArrayList();
	/** Public identifier. */
	protected String publicId = "algorithms.dtd";
	/** System identifier. */
	protected String systemId = "algorithms.dtd";

	/**
	 * Creates an empty MiningAlgorithms object
	 */
	public MiningAlgorithms()
	{
		super();
	}

	/**
	 * Returns an array of AlgorithmSpecification objects. The length of the returned
	 * array is zero if the list of AlgorithmSpecification object is empty.
	 */
	public AlgorithmSpecification[] getAlgorithmSpecification()
	{
		return (AlgorithmSpecification[])_objAlgorithmSpecification.toArray(new AlgorithmSpecification[0]);
	}

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

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

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

	/**
	 * Returns the number of AlgorithmSpecification objects in the list.
	 */
	public int getAlgorithmSpecificationCount()
	{
		return _objAlgorithmSpecification.size();
	}

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

	/**
	 * Returns a read-only list of AlgorithmSpecification objects.
	 */
	public List getAlgorithmSpecificationList()
	{
		return Collections.unmodifiableList(_objAlgorithmSpecification);
	}

	/**
	 * Adds a new AlgorithmSpecification 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 addAlgorithmSpecification(AlgorithmSpecification obj)
	{
		if( obj==null )
			return false;

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

	/**
	 * Adds a list of new AlgorithmSpecification 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 addAlgorithmSpecification(Collection coAlgorithmSpecification)
	{
		if( coAlgorithmSpecification==null )
			return false;

		java.util.Iterator it = coAlgorithmSpecification.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 _objAlgorithmSpecification.addAll(coAlgorithmSpecification);
	}

	/**
	 * Removes an existing AlgorithmSpecification object at the specified index.
	 * @return	The removed object.
	 */
	public AlgorithmSpecification removeAlgorithmSpecification(int index)
	{
		return (AlgorithmSpecification)_objAlgorithmSpecification.remove(index);
	}

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

	/**
	 * Clears all AlgorithmSpecification objects from the list.
	 */
	public void clearAlgorithmSpecificationList()
	{
		_objAlgorithmSpecification.clear();
	}
	/**
	 * Marshals this object to an XML instance and outputs it to the specifed output stream.
	 * @param out	OutputStream object to receive the output of the XML instance.
	 * @throws	java.io.IOException	Couldn't create the XML document.
	 */
	public void marshal(java.io.OutputStream out)
	throws java.io.IOException
	{
		com.borland.xml.toolkit.Element elem = marshal();
		com.borland.xml.toolkit.XmlUtil.writeDocument( out, elem, getPublicId(), getSystemId() );
	}

	/**
	 * Marshals this object to an XML instance and stores it in the specified file.
	 * @param fileName	File to store the output of the XML instance.
	 * @throws	java.io.IOException	Failed to get a FileOutputStream or to create the
	 * XML document.
	 */
	public void marshal(String fileName)
	throws java.io.IOException
	{
		com.borland.xml.toolkit.Element elem = marshal();
		com.borland.xml.toolkit.XmlUtil.writeDocument( fileName, elem, getPublicId(), getSystemId() );
	}

	/**
	 * Marshals this object to an XML instance and stores it in the specified file.
	 * @param file	File to store the output of the XML instance.
	 * @throws	java.io.IOException	Failed to get a FileOutputStream or to create the
	 * XML document.
	 */
	public void marshal(java.io.File file)
	throws java.io.IOException
	{
		com.borland.xml.toolkit.Element elem = marshal();
		com.borland.xml.toolkit.XmlUtil.writeDocument( file, elem, getPublicId(), getSystemId() );
	}

	/**
	 * Marshals this object to an XML instance and outputs it to the specified writer.
	 * @param writer	Writer object to receive the output of the XML instance.
	 * @throws	java.io.IOException	Failed to create the XML document.
	 */
	public void marshal(java.io.Writer writer)
	throws java.io.IOException
	{
		com.borland.xml.toolkit.Element elem = marshal();
		com.borland.xml.toolkit.XmlUtil.writeDocument( writer, elem, getPublicId(), getSystemId() );
	}

	/**
	 * Unmarshals an XML document back to a MiningAlgorithms object from an input stream.
	 * @param in	The InputStream object to read the XML document.
	 */
	public static MiningAlgorithms unmarshal(java.io.InputStream in)
	{
		return MiningAlgorithms.unmarshal(com.borland.xml.toolkit.XmlUtil.getDocRootElement(in));
	}

	/**
	 * Unmarshals an XML document back to a MiningAlgorithms object from a file.
	 * @param file	A File object.
	 */
	public static MiningAlgorithms unmarshal(java.io.File file)
	{
		return MiningAlgorithms.unmarshal(com.borland.xml.toolkit.XmlUtil.getDocRootElement(file));
	}

	/**
	 * Unmarshals an XML document back to a MiningAlgorithms object from a file.
	 * @param fileName	File name of XML document.
	 */
	public static MiningAlgorithms unmarshal(String fileName)
	{
		return MiningAlgorithms.unmarshal(com.borland.xml.toolkit.XmlUtil.getDocRootElement(fileName));
	}

	/**
	 * Unmarshals an XML document back to a MiningAlgorithms object from a reader.
	 * @param reader	A Reader object.
	 */
	public static MiningAlgorithms unmarshal(java.io.Reader reader)
	{
		return MiningAlgorithms.unmarshal(com.borland.xml.toolkit.XmlUtil.getDocRootElement(reader));
	}

	/**
	 * Gets public identifier.
	 */
	public String getPublicId()
	{
		return publicId;
	}

	/**
	 * Sets public identifier.
	 */
	public void setPublicId(String publicId)
	{
		this.publicId = publicId;
	}

	/**
	 * Gets system identifier.
	 */
	public String getSystemId()
	{
		return systemId;
	}

	/**
	 * Sets system identifier.
	 */
	public void setSystemId(String systemId)
	{
		this.systemId = systemId;
	}

	/**
	 * 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 a list of AlgorithmSpecification objects to elements */
		Iterator it1 = _objAlgorithmSpecification.iterator();
		while( it1.hasNext() )
		{
			AlgorithmSpecification obj = (AlgorithmSpecification)it1.next();
			if( obj != null )
				elem.addContent(obj.marshal());
		}

		return elem;
	}

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

		MiningAlgorithms __objMiningAlgorithms = new MiningAlgorithms();
		/** Unmarshals a list of "<<_tagName_>>" elements back to AlgorithmSpecification objects. */
		Iterator it1 = elem.getChildren(AlgorithmSpecification._tagName).iterator();
		while( it1.hasNext() )
			__objMiningAlgorithms.addAlgorithmSpecification(AlgorithmSpecification.unmarshal((com.borland.xml.toolkit.Element)it1.next()));

		return __objMiningAlgorithms;
	}

	/**
	 * 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();

		/** AlgorithmSpecification is zero or more */
		Iterator it1 = _objAlgorithmSpecification.iterator();
		while( it1.hasNext() )
		{
			AlgorithmSpecification obj = (AlgorithmSpecification)it1.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 _objAlgorithmSpecification */
		if( _objAlgorithmSpecification != null && _objAlgorithmSpecification.size() > 0 )
			children.add(_objAlgorithmSpecification);
		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 + -