亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nodefactory.java

?? 為了下東西 隨便發了個 datamining 的源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 *    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.IOException;
import java.io.StringReader;
import java.util.Hashtable;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import eti.bi.alphaminer.operation.operator.DefaultOperatorDefinitionConstant;
import eti.bi.alphaminer.operation.operator.NodeInfo;
import eti.bi.alphaminer.vo.BICase;
import eti.bi.alphaminer.vo.DataNode;
import eti.bi.alphaminer.vo.ModelNode;
import eti.bi.alphaminer.vo.Node;
import eti.bi.alphaminer.vo.OperatorNode;
import eti.bi.alphaminer.vo.TaskNode;

/**
 * NodeFactory is responsible for creating different kind of node instances
 * for a specific case.
 */
public class NodeFactory {


	
	/**
	 * Different type of node.
	 */
	public static final int TASK = 0;
	public static final int MODEL = 1;
	public static final int OPERATOR = 2;
	public static final int DATA = 3;

	/**
	 * Creates a specific kind of node.
	 * @param a_CaseID ID of the case the node to be added.
	 * @param a_NodeType type of the node to be created.
	 * @return a Node object.
	 */
	public static Node createNode(String a_CaseID, int a_NodeType) {
		Node nodeObject = null;

		if (a_NodeType == TASK)
			nodeObject = new TaskNode(a_CaseID);
		else if (a_NodeType == MODEL)
			nodeObject = new ModelNode(a_CaseID);
		else if (a_NodeType == OPERATOR)
			nodeObject = new OperatorNode(a_CaseID);
		else if (a_NodeType == DATA)
			nodeObject = new DataNode(a_CaseID);
		else
			System.err.println("In NodeFactory:createNode: invalid node type");

		return nodeObject;
	}

	/**
	 * Creates a specific kind of node by copying the given node.
	 * @param a_CaseID ID of the case the node to be added.
	 * @param a_Node the node to be copied.
	 * @return a Node object.
	 */
	public static Node createNode(String a_CaseID, Node a_Node) {
		Node newNode = null;
		if (a_Node instanceof TaskNode)
			newNode = new TaskNode(a_CaseID, (TaskNode) a_Node);
		else if (a_Node instanceof OperatorNode)
			newNode = new OperatorNode(a_CaseID, (OperatorNode) a_Node);
		else if (a_Node instanceof ModelNode)
			newNode = new ModelNode(a_CaseID, (ModelNode) a_Node);
		else if (a_Node instanceof DataNode)
			newNode = new DataNode(a_CaseID, (DataNode) a_Node);
		else
			System.err.println("In NodeFactory:createNode: invalid node type");
		return newNode;
	}

	/**
	 * Creates an Operator Node of a particular type.
	 * @param a_CaseID ID of the case the node to be added.
	 * @param a_OperatorNodeType type of operator node to be created.
	 * @return a Node object.
	 */
	public static Node createOperatorNode(
		String a_CaseID,
		NodeInfo a_NodeInfo) {
		OperatorNode nodeObject = new OperatorNode(a_CaseID,a_NodeInfo);
		//nodeObject.setOperatorNodeType(a_OperatorNodeType);		
		return (Node) nodeObject;
	}
	
	/**
	 * Inserts header information and TaskNode into the Case base on 
	 * the node content provided.
	 * @param a_Case Case instance to be set.
	 * @param a_CaseString Content of the Case to be created.
	 * @return the Case instance after adding the information.
	 */
	public static BICase insertHeaderAndTaskNode(
		BICase a_Case,
		String a_CaseString) {
		DefaultHandler aHandler = new CMLSAXHandler(a_Case);
		try {
			SAXParserFactory factory = SAXParserFactory.newInstance();
			SAXParser saxParser = factory.newSAXParser();
			StringReader aStringReader = new StringReader(a_CaseString);
			saxParser.parse(new InputSource(aStringReader), aHandler);
		} catch (SAXException e) {
			// TODO
		} catch (ParserConfigurationException e) {
		} catch (IOException e) {
		}
		return ((BISAXHandler) aHandler).getCaseObject();
	}

	/**
	 * Inserts operator nodes and process into the Case base on 
	 * the case content provided.
	 * @param a_Case Case instance to be set.
	 * @param a_CaseString Content of the Case to be created.
	 * @return the Case instance after adding the information.
	 */
	public static BICase insertProcessNodes(BICase a_Case, String a_CaseString) {
		DefaultHandler aHandler = new PMLSAXHandler(a_Case);

		try {
			SAXParserFactory factory = SAXParserFactory.newInstance();
			SAXParser saxParser = factory.newSAXParser();
			StringReader aStringReader = new StringReader(a_CaseString);
			saxParser.parse(new InputSource(aStringReader), aHandler);
		} catch (SAXException e) {
			// TODO
		} catch (ParserConfigurationException e) {
		} catch (IOException e) {
		}
		return ((BISAXHandler) aHandler).getCaseObject();
	}
}

/**
 * BISAXHandler is responsible for parsing XML documents to create instance of
 * different classes.
 */
class BISAXHandler extends DefaultHandler {
	
	/**
	 * Instances with properties based on the XML contents
	 */
	eti.bi.alphaminer.vo.Node m_Node = null;
	BICase m_Case = null;

	/**
	 * Gets the Case after setting the case properties.
	 * @return Case being set.
	 */
	public BICase getCaseObject() {
		return m_Case;
	}
}

/**
 * CMLSAXHandler is responsible for pasing CML which is a well-structured document
 * in XML format.
 */
class CMLSAXHandler extends BISAXHandler {

	final static String a_Type = "CML";
	StringBuffer m_TextBuffer;
	String m_StartElement;
	Hashtable<String, String> m_AttrMap;
	StringBuffer m_ElementTree = new StringBuffer("");
	
	/**
	 * Constructs a CMLSAXHandler.
	 * @param a_Case the Case object to be set.
	 */
	public CMLSAXHandler(BICase a_Case) {
		super();
		m_Node = new TaskNode();
		m_Case = a_Case;
	}

	/**
	 * @see org.xml.sax.ContentHandler#characters(char[], int, int)
	 */
	public void characters(char[] buf, int offset, int len)
		throws SAXException {
	}

	/**
	 * @see org.xml.sax.ContentHandler#endElement(String, String, String)
	 */
	public void endElement(
		String aNamespaceURI,
		String aSimpleName,
		String aQualifiedName)
		throws SAXException {
		String aElementName = aSimpleName; // element name
		if ("".equals(aElementName))
			aElementName = aQualifiedName; // not namespaceAware
		if (aElementName.equals("CML"))
			m_Case.setNode((TaskNode) m_Node);
		m_AttrMap = null;
	}

	/**
	 * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)
	 */
	public void startElement(
		String aNamespaceURI,
		String aSimpleName,
		String aQualifiedName,
		Attributes aAttrs)
		throws SAXException {
		String aElementName = aSimpleName; // element name
		m_AttrMap = new Hashtable<String, String>();
		if ("".equals(aElementName)) {
			aElementName = aQualifiedName; // not namespaceAware
		}

		if (aAttrs != null) {
			for (int i = 0; i < aAttrs.getLength(); i++) {
				String aAttrName = aAttrs.getLocalName(i); // Attr name
				if ("".equals(aAttrName))
					aAttrName = aAttrs.getQName(i);
				m_AttrMap.put(aAttrName, aAttrs.getValue(i));
			}
		}

		if (aElementName.equals("CreateDate")) {
			m_Case.setCreateDate(m_AttrMap.get("value"));
		} else if (aElementName.equals("CaseDescription")) {
			m_Case.setCaseDescription(m_AttrMap.get("value"));
		} else if (aElementName.equals("Status")) {
			m_Case.setStatus(m_AttrMap.get("value"));
		//<<21/02/2005 Mark Li: Add Case Name
		} else if (aElementName.equals("CaseName")) {
			((TaskNode) m_Node).setCaseName(m_AttrMap.get("value"));	
        //21/02/2005 Mark Li: Add Case Name>>	

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久久久久浪潮 | 1区2区3区国产精品| 国产午夜亚洲精品不卡| 成人免费视频在线观看| 亚洲综合男人的天堂| 国产精品嫩草99a| 欧美不卡在线视频| 91丨九色丨尤物| 狠狠色狠狠色合久久伊人| 国产精品久久一卡二卡| 一区二区三区不卡视频| 国产精品一区三区| 色综合久久久久| 久久综合九色综合欧美就去吻 | aaa欧美大片| 久久99在线观看| 亚洲蜜桃精久久久久久久| 欧美xxxxxxxx| 精品盗摄一区二区三区| 日韩午夜av电影| 在线观看91av| 26uuu国产电影一区二区| 在线不卡免费欧美| 欧美日韩亚洲综合一区二区三区| 欧美电影在哪看比较好| 亚洲精品一区二区精华| 久久精品综合网| 久久老女人爱爱| 亚洲欧美日韩小说| 亚洲gay无套男同| 蜜桃久久av一区| 国产91精品免费| 激情综合网av| 成人性生交大片免费 | 久久综合丝袜日本网| 中文字幕免费不卡| 97se亚洲国产综合自在线| 国产成人在线观看| 一道本成人在线| 99精品国产一区二区三区不卡| 日本vs亚洲vs韩国一区三区 | 99精品热视频| 亚洲一区在线观看视频| 亚洲视频电影在线| 欧美日韩国产色站一区二区三区| 亚洲成人免费在线观看| 精品88久久久久88久久久| 欧美成人a∨高清免费观看| 久久福利视频一区二区| 欧美激情一区二区在线| 高清国产一区二区三区| 亚洲午夜羞羞片| 久久精品欧美日韩| 久久99久久久久久久久久久| 免费亚洲电影在线| 欧美一区二区三区日韩视频| 亚洲国产精品精华液网站| 成人在线一区二区三区| 欧美人牲a欧美精品| 亚洲一区二区在线视频| 99久久久国产精品| 国产亚洲精品精华液| 久久精品国内一区二区三区| 欧美又粗又大又爽| 怡红院av一区二区三区| 97久久超碰精品国产| 欧美国产日韩a欧美在线观看| 精品一区二区国语对白| 2023国产精品| 国产毛片一区二区| 中文字幕不卡三区| 欧美日韩一区二区三区在线 | 91蝌蚪国产九色| 国产三级久久久| 国产传媒久久文化传媒| 亚洲欧美国产毛片在线| 成人一区二区三区中文字幕| 精品国内二区三区| 最新国产成人在线观看| 精品综合免费视频观看| 久久久久亚洲综合| 91精品国产免费久久综合| 精品少妇一区二区三区在线播放| 欧美精品成人一区二区三区四区| 中文字幕不卡三区| 精品久久一区二区| 日韩亚洲国产中文字幕欧美| 欧美性大战久久| 成人亚洲一区二区一| 日日摸夜夜添夜夜添亚洲女人| 一区二区三区在线播放| 18成人在线观看| 国产成人精品aa毛片| 欧美第一区第二区| k8久久久一区二区三区| 丝袜a∨在线一区二区三区不卡| 精品国产一区二区三区不卡| 色综合视频在线观看| 国产成人在线观看免费网站| 自拍av一区二区三区| 欧美成人一区二区三区在线观看| 成人av网址在线| 日韩电影免费一区| 亚洲精品免费播放| 久久综合九色综合欧美亚洲| 精品88久久久久88久久久| 欧美福利视频导航| 欧美午夜不卡在线观看免费| bt7086福利一区国产| 白白色 亚洲乱淫| 国产麻豆精品久久一二三| 日韩影院在线观看| 国产精品欧美经典| 在线不卡的av| 日韩欧美色综合| 欧美三区在线观看| 成人国产精品免费观看动漫| 国产福利91精品| 国产成人免费av在线| 粉嫩一区二区三区在线看| 99久久精品99国产精品| 成人黄色小视频在线观看| 国产精一区二区三区| 日本一区免费视频| 欧美国产精品劲爆| 日韩国产在线观看| 亚洲男同性恋视频| 午夜欧美视频在线观看| 国产精品一卡二卡在线观看| 欧美日韩成人综合在线一区二区| 中文字幕欧美国产| 午夜电影网一区| 成人妖精视频yjsp地址| 91精品国产福利| 一区二区三区四区激情| 国产老肥熟一区二区三区| 91精品国产综合久久香蕉的特点 | 欧美成人女星排名| 中文字幕一区视频| 国产成人精品免费网站| 欧美一区二区三区四区高清| 亚洲精品国产精品乱码不99| 欧美在线制服丝袜| 国产视频亚洲色图| 国产在线精品国自产拍免费| 欧美一区二区三区喷汁尤物| 国产精品国产三级国产| 国产乱一区二区| 日本一区二区三区久久久久久久久不| 精品一二三四区| 国产亚洲女人久久久久毛片| 日韩成人一级大片| 色吧成人激情小说| 亚洲一区二区三区影院| 91色乱码一区二区三区| 亚洲综合激情网| 欧美日韩一区三区四区| 午夜a成v人精品| 日韩欧美成人一区| 激情国产一区二区| 国产精品久久久久久一区二区三区| 国产一区二区三区四| 中文字幕巨乱亚洲| 在线免费亚洲电影| 成人免费av在线| 日韩欧美电影一二三| 欧美性受xxxx黑人xyx性爽| 男女性色大片免费观看一区二区 | 精品美女一区二区三区| 欧美一区二区免费| 一区二区三区免费在线观看| 久久国产精品露脸对白| 夜色激情一区二区| 欧美在线观看视频一区二区| 夜夜嗨av一区二区三区四季av| 色婷婷国产精品久久包臀| 一区二区三区免费看视频| 在线一区二区三区做爰视频网站| 亚洲综合视频在线| 欧美精品第1页| 韩国av一区二区三区| 欧美主播一区二区三区| 丁香激情综合五月| 日韩国产欧美在线观看| 中文字幕在线视频一区| 精品人在线二区三区| 欧美日韩在线三级| 色综合久久综合网97色综合| 久久66热re国产| 日本视频免费一区| 国产午夜精品久久| 亚洲精品在线三区| 欧美一区二区黄| 91精品欧美久久久久久动漫| a4yy欧美一区二区三区| 国产福利91精品一区二区三区| 午夜精品福利一区二区三区蜜桃| 一区二区三区四区精品在线视频| 亚洲欧美日韩一区二区| 中文字幕av一区二区三区免费看|