本文整理汇总了Java中org.knime.core.node.CanceledExecutionException类的典型用法代码示例。如果您正苦于以下问题:Java CanceledExecutionException类的具体用法?Java CanceledExecutionException怎么用?Java CanceledExecutionException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CanceledExecutionException类属于org.knime.core.node包,在下文中一共展示了CanceledExecutionException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadInternals
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void loadInternals(final File internDir,
final ExecutionMonitor exec) throws IOException,
CanceledExecutionException {
// TODO load internal data.
// Everything handed to output ports is loaded automatically (data
// returned by the execute method, models loaded in loadModelContent,
// and user settings set through loadSettingsFrom - is all taken care
// of). Load here only the other internals that need to be restored
// (e.g. data used by the views).
logger.info("---------------- ENTRANDO NO MÉTODO loadInternals()-----------------------");
logger.info("String m_selStr: " + m_selStr.toString());
}
示例2: suspendExecution
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* Wait for the user to continue or terminate the loop.
*
* @param exec
* the execution context
* @throws InterruptedException
* @throws CanceledExecutionException
*/
private void suspendExecution(final ExecutionContext exec)
throws InterruptedException, CanceledExecutionException {
m_semaphore.setState(false);
stateChanged();
while (!m_semaphore.getState()) {
Thread.sleep(1000);
try {
exec.checkCanceled();
} catch (final CanceledExecutionException e) {
m_semaphore.setState(true);
stateChanged();
throw e;
}
}
m_curIterationIndex++;
}
示例3: loadInternals
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void loadInternals(final File nodeInternDir,
final ExecutionMonitor exec)
throws IOException, CanceledExecutionException {
final String path = nodeInternDir.getAbsolutePath();
final File file = new File(path + "LoopEndNode.intern");
final DataInputStream is =
new DataInputStream(new FileInputStream(file));
final int numClasses = is.readInt();
for (int i = 0; i < numClasses; i++) {
m_classModel.addClass(is.readUTF());
}
is.close();
}
示例4: saveInternals
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File nodeInternDir,
final ExecutionMonitor exec)
throws IOException, CanceledExecutionException {
final String path = nodeInternDir.getAbsolutePath();
final File file = new File(path + "LoopEndNode.intern");
// save the defined classes
final DataOutputStream os =
new DataOutputStream(new FileOutputStream(file));
os.writeInt(m_classModel.getSize());
for (final String clsName : m_classModel.getDefinedClasses()) {
os.writeUTF(clsName);
}
os.close();
}
示例5: execute
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* Execute the snippet.
*
* @param table
* the data table at the inport
* @param flowVariableRepository
* the flow variables at the inport
* @param exec
* the execution context to report progress
* @return the table for the output
* @throws InvalidSettingsException
* when settings are inconsistent with the table or the flow
* variables at the input
* @throws CanceledExecutionException
* when execution is canceled by the user
*/
public BufferedDataTable execute(final BufferedDataTable table,
final FlowVariableRepository flowVariableRepository,
final ExecutionContext exec) throws CanceledExecutionException,
InvalidSettingsException {
OutColList outFields = m_fields.getOutColFields();
if (outFields.size() > 0) {
ColumnRearranger rearranger = createRearranger(
table.getDataTableSpec(), flowVariableRepository,
table.getRowCount());
return exec.createColumnRearrangeTable(table, rearranger, exec);
} else {
CellFactory factory = new JavaSnippetCellFactory(this,
table.getDataTableSpec(), flowVariableRepository,
table.getRowCount());
for (DataRow row : table) {
factory.getCells(row);
}
return table;
}
}
示例6: endElement
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
@Override
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
throws SAXException
{
if(builder!=null)
{
DataRow row=new DefaultRow(RowKey.createRowKey(++rowOut),new IntCell(Integer.parseInt(builder.toString())));
container.addRowToTable(row);
exec.setProgress("ESearch "+(rowOut));
try {
exec.checkCanceled();
} catch (CanceledExecutionException e) {
throw new SAXException(e);
}
}
builder=null;
}
示例7: getIndex
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
private GeocodingResult getIndex(String address, List<GeocodingResult> choices, GeocodingResult defaultValue)
throws CanceledExecutionException {
if (choices.size() == 0) {
return defaultValue;
} else if (choices.size() == 1) {
return choices.get(0);
} else if (set.getMultipleResults() == GeocodingSettings.Multiple.DO_NOT_USE) {
return defaultValue;
} else if (set.getMultipleResults() == GeocodingSettings.Multiple.USE_FIRST) {
return choices.get(0);
} else if (set.getMultipleResults() == GeocodingSettings.Multiple.ASK_USER) {
ChooseDialog dialog = new ChooseDialog(address, choices, defaultValue);
dialog.setVisible(true);
if (dialog.isCanceled()) {
throw new CanceledExecutionException();
}
return dialog.getResult();
}
return defaultValue;
}
示例8: testWithoutWeights
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
@Test
public void testWithoutWeights() throws PersistenceException, CanceledExecutionException {
Mockito.when(view.getEdgeWeight(e12)).thenReturn(1.0);
Mockito.when(view.getEdgeWeight(e13)).thenReturn(1.0);
Mockito.when(view.getEdgeWeight(e14)).thenReturn(1.0);
Mockito.when(view.getEdgeWeight(e15)).thenReturn(1.0);
Mockito.when(view.getEdgeWeight(e23)).thenReturn(1.0);
Mockito.when(view.getEdgeWeight(e34)).thenReturn(1.0);
ClosenessAnalyzerType analyzer = new ClosenessAnalyzerType();
analyzer.initializeInternal(view, new ExecutionMonitor());
assertEquals(1.0 / 4.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n1)[0], 0.0);
assertEquals(1.0 / 6.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n2)[0], 0.0);
assertEquals(1.0 / 5.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n3)[0], 0.0);
assertEquals(1.0 / 6.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n4)[0], 0.0);
assertEquals(1.0 / 7.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n5)[0], 0.0);
}
示例9: testWithWeights
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
@Test
public void testWithWeights() throws PersistenceException, CanceledExecutionException {
Mockito.when(view.getEdgeWeight(e12)).thenReturn(2.0);
Mockito.when(view.getEdgeWeight(e13)).thenReturn(2.0);
Mockito.when(view.getEdgeWeight(e14)).thenReturn(2.0);
Mockito.when(view.getEdgeWeight(e15)).thenReturn(2.0);
Mockito.when(view.getEdgeWeight(e23)).thenReturn(1.0);
Mockito.when(view.getEdgeWeight(e34)).thenReturn(1.0);
ClosenessAnalyzerType analyzer = new ClosenessAnalyzerType();
analyzer.initializeInternal(view, new ExecutionMonitor());
assertEquals(1.0 / 8.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n1)[0], 0.0);
assertEquals(1.0 / 9.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n2)[0], 0.0);
assertEquals(1.0 / 8.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n3)[0], 0.0);
assertEquals(1.0 / 9.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n4)[0], 0.0);
assertEquals(1.0 / 14.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n5)[0], 0.0);
}
示例10: initializeInternal
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
@Override
protected void initializeInternal(KPartiteGraphView<PersistentObject, Partition> view, ExecutionMonitor exec)
throws PersistenceException, CanceledExecutionException {
super.initializeInternal(view, exec);
numberOfNodes = (int) view.getNoOfNodes();
numberOfEdges = (int) view.getNoOfEdges();
edgeWeights.clear();
incidentNodes.clear();
outgoingEdges.clear();
for (PersistentObject edge : view.getEdges()) {
edgeWeights.put(edge.getId(), view.getEdgeWeight(edge));
incidentNodes.put(edge.getId(),
view.getIncidentNodes(edge).stream().map(o -> o.getId()).collect(Collectors.toList()));
}
if (edgeWeights.values().stream().allMatch(v -> v == 1.0)) {
edgeWeights.clear();
}
for (PersistentObject node : view.getNodes()) {
outgoingEdges.put(node.getId(),
view.getOutgoingEdges(node).stream().map(o -> o.getId()).collect(Collectors.toList()));
}
}
示例11: saveInternals
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File internDir,
final ExecutionMonitor exec) throws IOException,
CanceledExecutionException {
// TODO save internal models.
// Everything written to output ports is saved automatically (data
// returned by the execute method, models saved in the saveModelContent,
// and user settings saved through saveSettingsTo - is all taken care
// of). Save here only the other internals that need to be preserved
// (e.g. data used by the views).
logger.info("---------------- ENTRANDO NO MÉTODO saveInternals()-----------------------");
logger.info("String m_selStr: " + m_selStr.toString());
}
示例12: loadInternals
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void loadInternals(final File nodeInternDir,
final ExecutionMonitor exec)
throws IOException, CanceledExecutionException {
//
}
示例13: saveInternals
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File nodeInternDir,
final ExecutionMonitor exec)
throws IOException, CanceledExecutionException {
//
}
示例14: loadInternals
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void loadInternals(final File nodeInternDir,
final ExecutionMonitor exec)
throws IOException, CanceledExecutionException {
// Nothing to do here
}
示例15: saveInternals
import org.knime.core.node.CanceledExecutionException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File nodeInternDir,
final ExecutionMonitor exec)
throws IOException, CanceledExecutionException {
// Nothing to do here
}