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

📄 caseinfolist.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.
 */

package eti.bi.alphaminer.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Hashtable;

/**
 * CaseInfoList is responsible for storing a list of CaseInformation.
 */
public class CaseInfoList implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * A Hashtable storing CaseInformation
	 */
	private Hashtable<String, CaseInformation> m_CaseInfoList;

	/**
	 * Constructs a CaseInfoList.
	 */
	public CaseInfoList() {
		m_CaseInfoList = new Hashtable<String, CaseInformation>();
	}

	
	/**
	 * Gets the CaseInfoList which is a Hashtable storing CaseInformation.
	 * @return CaseInfoList storing CaseInformation.
	 */
	public Hashtable<String, CaseInformation> getCaseInfoList() {
		return m_CaseInfoList;
	}

	/**
	 * Sets the a collection of CaseInformation in the CaseInfoList.
	 * @param a_CaseInfoList the Hashtable sotring all CaseInformation to be set.
	 */
	public void setCaseInfoList(Hashtable<String, CaseInformation> a_CaseInfoList) {
		m_CaseInfoList = a_CaseInfoList;
	}

	/**
	 * Gets all CaseInformation stored in the CaseInfoList in an array.
	 * @return an array of CaseInformation.
	 */
	public CaseInformation[] getCaseInfoArray(String a_DMEngineName) {
		//<<Frank J. Xu, 20/01/2005
		//To adapt to different DM Engine.
		CaseInformation[] caseInfo = null;
		CaseInformation tempCaseInfo;
		ArrayList<CaseInformation> caseInfoList = new ArrayList<CaseInformation>();
		int nCaseInfoListSize = 0;
		
		Object[] objectArray = m_CaseInfoList.values().toArray();
		if (objectArray == null || objectArray.length == 0)
			return null;

		for (int i = 0; i < objectArray.length; i++)
		{
			tempCaseInfo = (CaseInformation) objectArray[i];
			if(tempCaseInfo.getToolUsed().equalsIgnoreCase(a_DMEngineName))
				caseInfoList.add(tempCaseInfo);
		}
		
		nCaseInfoListSize = caseInfoList.size();
		if(nCaseInfoListSize>0){
			caseInfo = new CaseInformation[nCaseInfoListSize];
			for (int i = 0; i < nCaseInfoListSize; i++)
			{
				caseInfo[i] = caseInfoList.get(i);				
			}			
		}
		//Frank J. Xu, 20/01/2005>>		
		return caseInfo;
	}

	/**
	 * Gets a specific CaseInformation.
	 * @param a_CaseID Case ID of the CaseInformation to be obtained.
	 * @return CaseInformation with the given Case ID.
	 */
	public CaseInformation getCaseInfo(String a_CaseID) {
		if (a_CaseID == null)
			System.err.println("In CaseInfoList:getCaseInfo: case ID is null");
		return m_CaseInfoList.get(a_CaseID);
	}

	/**
	 * Sets a specific CaseInformation.
	 * @param a_CaseInformation the CaseInformation to be set.
	 */
	public void setCaseInfo(CaseInformation a_CaseInformation) {
		if (a_CaseInformation == null)
			System.err.println(
				"In CaseInfoList:setCaseInfo: case information is null");
		m_CaseInfoList.put(a_CaseInformation.getCaseID(), a_CaseInformation);
	}
}

⌨️ 快捷键说明

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