本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}