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

📄 centerfields.java

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

package com.prudsys.pdm.Adapters.PmmlVersion20;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/**
 * The CenterFields class represents the element "CenterFields" with the content
 * model defined as follows:
 * <p>
 * &lt;!ELEMENT CenterFields (NormContinuous|NormDiscrete)+&gt;<br>
 */
public class CenterFields extends com.borland.xml.toolkit.XmlObject 
{
	/** xml tag name of this element. */
	public static String _tagName = "CenterFields";
	/** Defines a list of NormContinuous objects. */
	protected ArrayList _objNormContinuous = new ArrayList();
	/** Defines a list of NormDiscrete objects. */
	protected ArrayList _objNormDiscrete = new ArrayList();

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

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

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

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

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

	/**
	 * Returns the number of NormContinuous objects in the list.
	 */
	public int getNormContinuousCount()
	{
		return _objNormContinuous.size();
	}

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

	/**
	 * Returns a read-only list of NormContinuous objects.
	 */
	public List getNormContinuousList()
	{
		return Collections.unmodifiableList(_objNormContinuous);
	}

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

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

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

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

	/**
	 * Removes an existing NormContinuous object at the specified index.
	 * @return	The removed object.
	 */
	public NormContinuous removeNormContinuous(int index)
	{
		return (NormContinuous)_objNormContinuous.remove(index);
	}

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

	/**
	 * Clears all NormContinuous objects from the list.
	 */
	public void clearNormContinuousList()
	{
		_objNormContinuous.clear();
	}
	/**
	 * Returns an array of NormDiscrete objects. The length of the returned
	 * array is zero if the list of NormDiscrete object is empty.
	 */
	public NormDiscrete[] getNormDiscrete()
	{
		return (NormDiscrete[])_objNormDiscrete.toArray(new NormDiscrete[0]);
	}

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

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

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

	/**
	 * Returns the number of NormDiscrete objects in the list.
	 */
	public int getNormDiscreteCount()
	{
		return _objNormDiscrete.size();
	}

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

	/**
	 * Returns a read-only list of NormDiscrete objects.
	 */
	public List getNormDiscreteList()
	{
		return Collections.unmodifiableList(_objNormDiscrete);
	}

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

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

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

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

	/**
	 * Removes an existing NormDiscrete object at the specified index.
	 * @return	The removed object.
	 */
	public NormDiscrete removeNormDiscrete(int index)
	{
		return (NormDiscrete)_objNormDiscrete.remove(index);
	}

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

	/**
	 * Clears all NormDiscrete objects from the list.
	 */
	public void clearNormDiscreteList()
	{
		_objNormDiscrete.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 a list of NormContinuous objects to elements */
		Iterator it1 = _objNormContinuous.iterator();
		while( it1.hasNext() )
		{
			NormContinuous obj = (NormContinuous)it1.next();
			if( obj != null )
				elem.addContent(obj.marshal());
		}
		/** Marshals a list of NormDiscrete objects to elements */
		Iterator it2 = _objNormDiscrete.iterator();
		while( it2.hasNext() )
		{
			NormDiscrete obj = (NormDiscrete)it2.next();
			if( obj != null )
				elem.addContent(obj.marshal());
		}

		return elem;
	}

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

		CenterFields __objCenterFields = new CenterFields();
		/** Unmarshals a list of "<<_tagName_>>" elements back to NormContinuous objects. */
		Iterator it1 = elem.getChildren(NormContinuous._tagName).iterator();
		while( it1.hasNext() )
			__objCenterFields.addNormContinuous(NormContinuous.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
		/** Unmarshals a list of "<<_tagName_>>" elements back to NormDiscrete objects. */
		Iterator it2 = elem.getChildren(NormDiscrete._tagName).iterator();
		while( it2.hasNext() )
			__objCenterFields.addNormDiscrete(NormDiscrete.unmarshal((com.borland.xml.toolkit.Element)it2.next()));

		return __objCenterFields;
	}

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

		/** "or" block */
		if( _objNormContinuous.size() > 0 )
		{
			/** NormContinuous is one or more */
			if( _objNormContinuous.size() == 0 )
			{
				errors.add(new com.borland.xml.toolkit.ElementError(this, NormContinuous.class));
				if( firstError )
					return errors;
			}
			else
			{
				Iterator it1 = _objNormContinuous.iterator();
				while( it1.hasNext() )
				{
					NormContinuous obj = (NormContinuous)it1.next();
					if( obj != null )
					{
						errors.add(obj.validate(firstError));
						if( firstError && errors.size() > 0 )
							return errors;
					}
				}
			}
		}
		if( _objNormDiscrete.size() > 0 )
		{
			/** NormDiscrete is one or more */
			if( _objNormDiscrete.size() == 0 )
			{
				errors.add(new com.borland.xml.toolkit.ElementError(this, NormDiscrete.class));
				if( firstError )
					return errors;
			}
			else
			{
				Iterator it2 = _objNormDiscrete.iterator();
				while( it2.hasNext() )
				{
					NormDiscrete obj = (NormDiscrete)it2.next();
					if( obj != null )
					{
						errors.add(obj.validate(firstError));
						if( firstError && errors.size() > 0 )
							return errors;
					}
				}
			}
		}
		if( !(_objNormContinuous.size() > 0) && !(_objNormDiscrete.size() > 0) )   /** missing one or more elements? */
		{
			com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
			errors1.add(new com.borland.xml.toolkit.ElementError(this, NormContinuous.class));
			errors1.add(new com.borland.xml.toolkit.ElementError(this, NormDiscrete.class));
			errors.add(errors1);
					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 _objNormContinuous */
		if( _objNormContinuous != null && _objNormContinuous.size() > 0 )
			children.add(_objNormContinuous);
		/** adds _objNormDiscrete */
		if( _objNormDiscrete != null && _objNormDiscrete.size() > 0 )
			children.add(_objNormDiscrete);
		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 + -