當前位置: 首頁>>代碼示例>>Java>>正文


Java XMLImporter.doAfterAutoWire方法代碼示例

本文整理匯總了Java中com.rapidminer.io.process.XMLImporter.doAfterAutoWire方法的典型用法代碼示例。如果您正苦於以下問題:Java XMLImporter.doAfterAutoWire方法的具體用法?Java XMLImporter.doAfterAutoWire怎麽用?Java XMLImporter.doAfterAutoWire使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.rapidminer.io.process.XMLImporter的用法示例。


在下文中一共展示了XMLImporter.doAfterAutoWire方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: apply

import com.rapidminer.io.process.XMLImporter; //導入方法依賴的package包/類
@Override
protected String apply(final Operator operator, final String operatorTypeName, final XMLImporter importer) {
	importer.doAfterAutoWire(new Runnable() {

		@Override
		public void run() {
			operator.remove();
			importer.addMessage("Removed operator '<var>" + operator.getName() + "</var>' (<code>" + operatorTypeName
					+ "</code>)");
		}
	});
	return null;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:14,代碼來源:DeleteAfterAutoWireRule.java

示例2: apply

import com.rapidminer.io.process.XMLImporter; //導入方法依賴的package包/類
@Override
protected String apply(final Operator operator, String operatorTypeName, XMLImporter importer) {
	importer.doAfterAutoWire(new Runnable() {

		@Override
		public void run() {
			OperatorChain chain = (OperatorChain) operator;
			ExecutionUnit unit = chain.getSubprocess(subprocess);
			for (Operator op : unit.getOperators()) {
				unit.autoWireSingle(op, CompatibilityLevel.PRE_VERSION_5, true, true);
			}
		}
	});
	return null;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:16,代碼來源:WireAllOperators.java

示例3: apply

import com.rapidminer.io.process.XMLImporter; //導入方法依賴的package包/類
@Override
protected String apply(final Operator operator, final String operatorTypeName, final XMLImporter importer) {
	importer.doAfterAutoWire(new Runnable() {
		@Override
		public void run() {
			operator.remove();
			importer.addMessage("Removed operator '<var>" + operator.getName() + "</var>' (<code>" + operatorTypeName + "</code>)");
		}
	});
	return null;
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:12,代碼來源:DeleteAfterAutoWireRule.java

示例4: apply

import com.rapidminer.io.process.XMLImporter; //導入方法依賴的package包/類
@Override
protected String apply(final Operator operator, String operatorTypeName, XMLImporter importer) {
	importer.doAfterAutoWire(new Runnable() {
		@Override
		public void run() {
			OperatorChain chain = (OperatorChain) operator;
			ExecutionUnit unit = chain.getSubprocess(subprocess);
			for (Operator op : unit.getOperators()) {
				unit.autoWireSingle(op, CompatibilityLevel.PRE_VERSION_5, true, true);
			}
		}			
	});
	return null;
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:15,代碼來源:WireAllOperators.java

示例5: apply

import com.rapidminer.io.process.XMLImporter; //導入方法依賴的package包/類
@Override
public String apply(final Operator operator, VersionNumber processVersion, final XMLImporter importer) {
	if (operator.getClass().equals(SimpleOperatorChain.class)
			&& (processVersion == null || processVersion.compareTo(APPLIES_UNTIL) < 0)) {
		importer.doAfterAutoWire(new Runnable() {

			@Override
			public void run() {
				OperatorChain chain = (OperatorChain) operator;
				InputPorts inputs = chain.getInputPorts();
				OutputPorts sources = chain.getSubprocess(0).getInnerSources();
				InputPorts sinks = chain.getSubprocess(0).getInnerSinks();
				OutputPorts outputs = chain.getOutputPorts();
				boolean found;
				do {
					found = false;
					for (int leftIndex = 0; leftIndex < sources.getNumberOfPorts(); leftIndex++) {
						OutputPort source = sources.getPortByIndex(leftIndex);
						if (!source.isConnected()) {
							continue;
						}
						InputPort sink = source.getDestination();
						if (sinks.getAllPorts().contains(sink)) {
							int rightIndex = sinks.getAllPorts().indexOf(sink);
							InputPort correspondingInput = inputs.getPortByIndex(leftIndex);
							OutputPort correspondingOutput = outputs.getPortByIndex(rightIndex);
							if (correspondingInput.isConnected() && correspondingOutput.isConnected()) {
								OutputPort originalSource = correspondingInput.getSource();
								InputPort finalDestination = correspondingOutput.getDestination();
								originalSource.lock();
								finalDestination.lock();

								originalSource.disconnect();
								source.disconnect();
								correspondingOutput.disconnect();

								originalSource.connectTo(finalDestination);

								originalSource.unlock();
								finalDestination.unlock();
								found = true;

								importer.addMessage("The connection from <code>" + source.getSpec()
										+ "</code> to <code>" + sink
										+ "</code> was replaced by the direct connection from <code>"
										+ originalSource.getSpec() + "</code> to <code>" + finalDestination.getSpec()
										+ "</code>.");
							}
						}
					}
				} while (found);
			}
		});
	}
	return null;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:57,代碼來源:PassthroughShortcutRule.java

示例6: apply

import com.rapidminer.io.process.XMLImporter; //導入方法依賴的package包/類
@Override
public String apply(final Operator operator, VersionNumber processVersion, final XMLImporter importer) {
	if (operator.getClass().equals(SimpleOperatorChain.class) && (processVersion == null || processVersion.compareTo(APPLIES_UNTIL) < 0)) {
		importer.doAfterAutoWire(new Runnable() {
			@Override
			public void run() {
				OperatorChain chain = (OperatorChain)operator;					
				InputPorts  inputs  = chain.getInputPorts();
				OutputPorts sources = chain.getSubprocess(0).getInnerSources();
				InputPorts  sinks   = chain.getSubprocess(0).getInnerSinks();
				OutputPorts outputs = chain.getOutputPorts();
				boolean found;
				do {
					found = false;
					for (int leftIndex = 0; leftIndex < sources.getNumberOfPorts(); leftIndex++) {
						OutputPort source = sources.getPortByIndex(leftIndex);
						if (!source.isConnected()) {
							continue;
						}
						InputPort sink = source.getDestination();
						if (sinks.getAllPorts().contains(sink)) {								
							int rightIndex = sinks.getAllPorts().indexOf(sink);
							InputPort correspondingInput = inputs.getPortByIndex(leftIndex);								
							OutputPort correspondingOutput = outputs.getPortByIndex(rightIndex);
							if (correspondingInput.isConnected() && correspondingOutput.isConnected()) {
								OutputPort originalSource   = correspondingInput.getSource();
								InputPort  finalDestination = correspondingOutput.getDestination();								
								originalSource.lock();
								finalDestination.lock();

								originalSource.disconnect();
								source.disconnect();
								correspondingOutput.disconnect();

								originalSource.connectTo(finalDestination);

								originalSource.unlock();
								finalDestination.unlock();
								found = true;

								importer.addMessage("The connection from <code>"+source.getSpec()+"</code> to <code>"+sink+"</code> was replaced by the direct connection from <code>"+originalSource.getSpec()+"</code> to <code>"+finalDestination.getSpec()+"</code>.");
							}
						}
					}
				} while (found);
			}			
		});
	}
	return null;
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:51,代碼來源:PassthroughShortcutRule.java

示例7: apply

import com.rapidminer.io.process.XMLImporter; //導入方法依賴的package包/類
@Override
protected String apply(final Operator operator, String operatorTypeName, final XMLImporter importer) {
	if (operator instanceof IOContainerWriter) {			
		importer.doAfterAutoWire(new Runnable() {
			@Override
			public void run() {
				IOContainerWriter ioContainerWriter = (IOContainerWriter) operator;
				String filenameBase;
				try {
					filenameBase = ioContainerWriter.getParameterAsString(IOContainerWriter.PARAMETER_FILENAME);
				} catch (UndefinedParameterError e1) {
					filenameBase = ioContainerWriter.getName();
				}
				int num = 0;
				for (int i = 0; i < ioContainerWriter.getInputPorts().getNumberOfPorts(); i++) {
					InputPort  input  = ioContainerWriter.getInputPorts().getPortByIndex(i);						
					if (input.isConnected()) {														
						OutputPort source = input.getSource();
						input.lock();
						source.lock();							
						try {
							source.disconnect();
							IOObjectWriter writer = OperatorService.createOperator(IOObjectWriter.class);
							writer.setParameter(IOObjectWriter.PARAMETER_OBJECT_FILE, filenameBase+"_"+(i+1));
							source.connectTo(writer.getInputPorts().getPortByIndex(0));
							
							OutputPort output = ioContainerWriter.getOutputPorts().getPortByIndex(i);
							if (output.isConnected()) {								
								InputPort dest = output.getDestination();
								output.lock();
								dest.lock();
								try {
									output.disconnect();
									writer.getOutputPorts().getPortByIndex(0).connectTo(dest);
								} finally {
									output.unlock();
									dest.unlock();
								}
							}
							num++;
						} catch (Exception e) {
							//LogService.getRoot().log(Level.WARNING, "Cannot insert IOObjectWriter: "+e, e);
							LogService.getRoot().log(Level.WARNING,
									I18N.getMessage(LogService.getRoot().getResourceBundle(), 
									"com.rapidminer.io.process.rules.ReplaceIOContainerWriter.inserting_ioobjectwriter_error", 
									e),
									e);
							importer.addMessage("<em class=\"error\">Error while replacing "+ioContainerWriter.getName()+": "+e+"</em>");
						} finally {
							input.unlock();
							source.unlock();
						}							
					}
				}
				ioContainerWriter.remove();
				importer.addMessage("Replaced <var>"+ioContainerWriter.getName()+"</var> (<code>"+ioContainerWriter.getOperatorDescription().getName()+"</code>) by "+num+" <code>IOObjectWriter</code>s</span>");				
			}				
		});
	}
	return null;
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:62,代碼來源:ReplaceIOContainerWriter.java


注:本文中的com.rapidminer.io.process.XMLImporter.doAfterAutoWire方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。