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

📄 itemset.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 Itemset class represents the element "Itemset" with the content
 * model defined as follows:
 * <p>
 * &lt;!ELEMENT Itemset (Extension*,ItemRef+)&gt;<br>
 */
public class Itemset extends com.borland.xml.toolkit.XmlObject 
{
	/** xml tag name of this element. */
	public static String _tagName = "Itemset";
	/** Defines a numberOfItems attribute */
	public com.borland.xml.toolkit.Attribute numberOfItems = new com.borland.xml.toolkit.Attribute("numberOfItems", "CDATA", "REQUIRED", "");
	/** Defines a support attribute */
	public com.borland.xml.toolkit.Attribute support = new com.borland.xml.toolkit.Attribute("support", "CDATA", "REQUIRED", "");
	/** Defines a id attribute */
	public com.borland.xml.toolkit.Attribute id = new com.borland.xml.toolkit.Attribute("id", "CDATA", "REQUIRED", "");
	/** Defines a list of Extension objects. */
	protected ArrayList _objExtension = new ArrayList();
	/** Defines a list of ItemRef objects. */
	protected ArrayList _objItemRef = new ArrayList();

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

	/**
	 * Gets the value of "numberOfItems" attribute.
	 */
	public String getNumberOfItems()
	{
		return numberOfItems.getValue();
	}

	/**
	 * Replaces the existing attribute value with a new value.
	 * @param value	New value.
	 */
	public void setNumberOfItems(String value_)
	{
		numberOfItems.setValue(value_ );
	}

	/**
	 * Gets the value of "support" attribute.
	 */
	public String getSupport()
	{
		return support.getValue();
	}

	/**
	 * Replaces the existing attribute value with a new value.
	 * @param value	New value.
	 */
	public void setSupport(String value_)
	{
		support.setValue(value_ );
	}

	/**
	 * Gets the value of "id" attribute.
	 */
	public String getId()
	{
		return id.getValue();
	}

	/**
	 * Replaces the existing attribute value with a new value.
	 * @param value	New value.
	 */
	public void setId(String value_)
	{
		id.setValue(value_ );
	}

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

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

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

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

	/**
	 * Returns the number of Extension objects in the list.
	 */
	public int getExtensionCount()
	{
		return _objExtension.size();
	}

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

	/**
	 * Returns a read-only list of Extension objects.
	 */
	public List getExtensionList()
	{
		return Collections.unmodifiableList(_objExtension);
	}

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

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

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

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

	/**
	 * Removes an existing Extension object at the specified index.
	 * @return	The removed object.
	 */
	public Extension removeExtension(int index)
	{
		return (Extension)_objExtension.remove(index);
	}

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

	/**
	 * Clears all Extension objects from the list.
	 */
	public void clearExtensionList()
	{
		_objExtension.clear();
	}
	/**
	 * Returns an array of ItemRef objects. The length of the returned
	 * array is zero if the list of ItemRef object is empty.
	 */
	public ItemRef[] getItemRef()
	{
		return (ItemRef[])_objItemRef.toArray(new ItemRef[0]);
	}

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

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

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

	/**
	 * Returns the number of ItemRef objects in the list.
	 */
	public int getItemRefCount()
	{
		return _objItemRef.size();
	}

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

	/**
	 * Returns a read-only list of ItemRef objects.
	 */
	public List getItemRefList()
	{
		return Collections.unmodifiableList(_objItemRef);
	}

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

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

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

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

	/**
	 * Removes an existing ItemRef object at the specified index.
	 * @return	The removed object.
	 */
	public ItemRef removeItemRef(int index)
	{
		return (ItemRef)_objItemRef.remove(index);
	}

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

	/**
	 * Clears all ItemRef objects from the list.
	 */
	public void clearItemRefList()
	{
		_objItemRef.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 "numberOfItems" attribute */
		elem.addAttribute(numberOfItems.marshal());
		/** Marshals "support" attribute */
		elem.addAttribute(support.marshal());
		/** Marshals "id" attribute */
		elem.addAttribute(id.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 list of ItemRef objects to elements */
		Iterator it2 = _objItemRef.iterator();
		while( it2.hasNext() )
		{
			ItemRef obj = (ItemRef)it2.next();
			if( obj != null )
				elem.addContent(obj.marshal());
		}

		return elem;
	}

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

		Itemset __objItemset = new Itemset();
		if( __objItemset != null ) //found the element?
		{
			/** Unmarshals "numberOfItems" attribute */
			__objItemset.numberOfItems.setValue(elem.getAttribute("numberOfItems"));
			/** Unmarshals "support" attribute */
			__objItemset.support.setValue(elem.getAttribute("support"));
			/** Unmarshals "id" attribute */
			__objItemset.id.setValue(elem.getAttribute("id"));
		}
		/** Unmarshals a list of "<<_tagName_>>" elements back to Extension objects. */
		Iterator it1 = elem.getChildren(Extension._tagName).iterator();
		while( it1.hasNext() )
			__objItemset.addExtension(Extension.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
		/** Unmarshals a list of "<<_tagName_>>" elements back to ItemRef objects. */
		Iterator it2 = elem.getChildren(ItemRef._tagName).iterator();
		while( it2.hasNext() )
			__objItemset.addItemRef(ItemRef.unmarshal((com.borland.xml.toolkit.Element)it2.next()));

		return __objItemset;
	}

	/**
	 * 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;
			}
		}
		/** ItemRef is one or more */
		if( _objItemRef.size() == 0 )
		{
			errors.add(new com.borland.xml.toolkit.ElementError(this, ItemRef.class));
			if( firstError )
				return errors;
		}
		else
		{
			Iterator it2 = _objItemRef.iterator();
			while( it2.hasNext() )
			{
				ItemRef obj = (ItemRef)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 _objItemRef */
		if( _objItemRef != null && _objItemRef.size() > 0 )
			children.add(_objItemRef);
		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 + -