当前位置: 首页>>代码示例>>Java>>正文


Java InvalidSettingsException类代码示例

本文整理汇总了Java中org.knime.core.node.InvalidSettingsException的典型用法代码示例。如果您正苦于以下问题:Java InvalidSettingsException类的具体用法?Java InvalidSettingsException怎么用?Java InvalidSettingsException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InvalidSettingsException类属于org.knime.core.node包,在下文中一共展示了InvalidSettingsException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateSettings

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/**
 * Verificar se as configurações podem ser aplicadas ao modelo.
 * <b>NÃO fazer nenhuma atribuição de valores do modelo aqui!!!!!</b><BR>
 * {@inheritDoc}
 */
@Override
protected void validateSettings(final NodeSettingsRO settings)
        throws InvalidSettingsException {
        
    // TODO check if the settings could be applied to our model
    // e.g. if the count is in a certain range (which is ensured by the
    // SettingsModel).
    // Do not actually set any values of any member variables.
	//m_str.validateSettings(settings);
	logger.info("---------------- ENTRANDO NO MÉTODO validateSettings()-----------------------");
	Iterator<String> it = settings.iterator();
	while (it.hasNext()) {
		String str = it.next();
		logger.info("settings: " + str);
	}
	logger.info("String m_selStr antes de validateSettings: " + m_selStr.getKey() + " = " + m_selStr.getStringValue());
	m_selStr.validateSettings(settings);
	logger.info("String m_selStr após validateSettings: " + m_selStr.getKey() + " = " + m_selStr.getStringValue());
}
 
开发者ID:daniacs,项目名称:knime_brtagger,代码行数:25,代码来源:BrTaggerNodeModel.java

示例2: configure

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@SuppressWarnings("deprecation")
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs)
        throws InvalidSettingsException {

    m_classColIdx = NodeUtils.autoColumnSelection(inSpecs[DATA_PORT],
            m_classColModel, StringValue.class, this.getClass());

    m_repColIdx = NodeUtils.autoColumnSelection(inSpecs[DATA_PORT],
            m_repColModel, DataValue.class, this.getClass());

    m_renderer = inSpecs[DATA_PORT].getColumnSpec(m_repColIdx).getType()
            .getRenderer(inSpecs[DATA_PORT].getColumnSpec(m_repColIdx));

    m_colNames = inSpecs[DATA_PORT].getColumnNames();

    // Pass through
    if (inSpecs[PASSTHROUGH_PORT] != null) {
        return new DataTableSpec[] { inSpecs[PASSTHROUGH_PORT] };
    }
    // else route the input port
    return new DataTableSpec[] { inSpecs[DATA_PORT] };
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:27,代码来源:ActiveLearnLoopEndNodeModel.java

示例3: initializeClassMap

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/**
 * Reads the classes from the ground truth table and adds them to the class
 * map.
 *
 * @param inData
 * @throws InvalidSettingsException
 */
private void initializeClassMap(final BufferedDataTable[] inData)
        throws InvalidSettingsException {
    final int classColIdxLabeledTable = NodeUtils.autoColumnSelection(
            inData[LABELED_PORT].getDataTableSpec(),
            m_groundTruthColumnModel, StringValue.class, this.getClass());

    // initialize all classes map
    m_allClassesMap = new HashMap<>((int)inData[LABELED_PORT].size());

    for (final DataRow row : inData[LABELED_PORT]) {
        m_allClassesMap.put(row.getKey(),
                ((StringCell) row.getCell(classColIdxLabeledTable))
                        .getStringValue());
    }
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:23,代码来源:DBGActiveLearnLoopEndNodeModel.java

示例4: configure

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs)
        throws InvalidSettingsException {

    // a^2
    final double alphaValue = m_radiusAlphaModel.getDoubleValue();
    m_alpha = 4.0d / (alphaValue * alphaValue);

    // a^2*rb^2
    m_beta = 4.0d / (alphaValue * alphaValue * FACTOR_RB * FACTOR_RB);

    m_exploitation = m_exploitationModel.getDoubleValue();

    m_classIdx = NodeUtils.autoColumnSelection(inSpecs[1], m_classColModel,
            StringValue.class, PBACScorerNodeModel.class);

    m_doubleIndices = NodeTools
            .collectAllColumnIndicesOfType(DoubleValue.class, inSpecs[0]);

    m_resSpec = createResRearranger(inSpecs[0]);

    return new DataTableSpec[] { m_resSpec.createSpec() };
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:27,代码来源:PBACScorerNodeModel.java

示例5: execute

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inData,
        final ExecutionContext exec) throws Exception {

    if (m_columnFilterModel.applyTo(inData[0].getDataTableSpec())
            .getIncludes().length == 0) {
        throw new InvalidSettingsException("No Columns selected!");
    }

    final ColumnRearranger c =
            createResRearranger(inData[0].getDataTableSpec());
    final BufferedDataTable out =
            exec.createColumnRearrangeTable(inData[0], c, exec);
    return new BufferedDataTable[] { out };
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:19,代码来源:AbstractUncertaintyNodeModel.java

示例6: createResRearranger

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/**
 * {@inheritDoc} Variance based score.
 */
@Override
protected ColumnRearranger createResRearranger(final DataTableSpec inSpec)
        throws InvalidSettingsException {
    final ColumnRearranger rearranger = new ColumnRearranger(inSpec);
    final DataColumnSpec newColSpec =
            new DataColumnSpecCreator("Variance Score", DoubleCell.TYPE)
                    .createSpec();

    // utility object that performs the calculation
    rearranger.append(new SingleCellFactory(newColSpec) {
        final List<Integer> m_selectedIndicies =
                NodeTools.getIndicesFromFilter(inSpec, m_columnFilterModel,
                        DoubleValue.class, VarianceScorerNodeModel.class);

        @Override
        public DataCell getCell(final DataRow row) {
            return new DoubleCell(MathUtils.variance(
                    NodeTools.toDoubleArray(row, m_selectedIndicies)));
        }
    });
    return rearranger;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:26,代码来源:VarianceScorerNodeModel.java

示例7: configure

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs)
        throws InvalidSettingsException {

    if (NodeTools.collectAllColumnIndicesOfType(DoubleValue.class,
            inSpecs[UNLABELED_PORT]).isEmpty()) {
        throw new InvalidSettingsException("No Double columns avaiable!");
    }

    m_beta = 4.0d / ((m_radiusAlphaModel.getDoubleValue() * FACTOR_RB)
            * (m_radiusAlphaModel.getDoubleValue() * FACTOR_RB));

    m_alpha = 4.0d / (m_radiusAlphaModel.getDoubleValue()
            * m_radiusAlphaModel.getDoubleValue());

    m_resSpec = createResRearranger(inSpecs[UNLABELED_PORT]);

    return new DataTableSpec[] { m_resSpec.createSpec() };
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:23,代码来源:NodePotentialScorerNodeModel.java

示例8: configure

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs)
        throws InvalidSettingsException
    {
    if(inSpecs==null || inSpecs.length!=1)
    	{
    	throw new InvalidSettingsException("Expected one table.");
    	}
   
    findColumnIndex(inSpecs[0],m_chromCol,StringCell.TYPE);
    findColumnIndex(inSpecs[0],m_posCol,IntCell.TYPE);
    findColumnIndex(inSpecs[0],m_refCol,StringCell.TYPE);
    findColumnIndex(inSpecs[0],m_altCol,StringCell.TYPE);
    
	return new DataTableSpec[0];
	}
 
开发者ID:lindenb,项目名称:knime4bio,代码行数:20,代码来源:AbstractPredictionOutNodeModel.java

示例9: loadSettings

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/** Loads parameters in NodeModel.
 * @param settings To load from.
 * @throws InvalidSettingsException If incomplete or wrong.
 */
public void loadSettings(final NodeSettingsRO settings)
        throws InvalidSettingsException {
    m_scriptImports = settings.getString(SCRIPT_IMPORTS);
    m_scriptFields = settings.getString(SCRIPT_FIELDS);
    m_scriptBody = settings.getString(SCRIPT_BODY);
    m_jarFiles = settings.getStringArray(JAR_FILES);
    m_outCols.loadSettings(settings.getConfig(OUT_COLS));
    m_outVars.loadSettings(settings.getConfig(OUT_VARS));
    m_inCols.loadSettings(settings.getConfig(IN_COLS));
    m_inVars.loadSettings(settings.getConfig(IN_VARS));
    m_version = settings.getString(VERSION);
    if (settings.containsKey(TEMPLATE_UUID)) {
        m_templateUUID = settings.getString(TEMPLATE_UUID);
    }
    // added in 2.8 (only java edit variable) -- 2.7 scripts were always run on execute()
    m_runOnExecute = settings.getBoolean(RUN_ON_EXECUTE, true);
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:22,代码来源:JavaSnippetSettings.java

示例10: loadSettingsForDialog

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/** Loads parameters in Dialog.
 * @param settings To load from.
 */
public void loadSettingsForDialog(final NodeSettingsRO settings) {
    try {
        m_scriptImports = settings.getString(SCRIPT_IMPORTS, "");
        m_scriptFields = settings.getString(SCRIPT_FIELDS, "");
        m_scriptBody = settings.getString(SCRIPT_BODY, null);
        m_jarFiles = settings.getStringArray(JAR_FILES, new String[0]);
        m_outCols.loadSettingsForDialog(settings.getConfig(OUT_COLS));
        m_outVars.loadSettingsForDialog(settings.getConfig(OUT_VARS));
        m_inCols.loadSettingsForDialog(settings.getConfig(IN_COLS));
        m_inVars.loadSettingsForDialog(settings.getConfig(IN_VARS));
        m_version = settings.getString(VERSION, JavaSnippet.VERSION_1_X);
        m_templateUUID = settings.getString(TEMPLATE_UUID, null);
        // added in 2.8 (only java edit variable)
        m_runOnExecute = settings.getBoolean(RUN_ON_EXECUTE, false);
    } catch (InvalidSettingsException e) {
        throw new IllegalStateException(e);
    }
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:22,代码来源:JavaSnippetSettings.java

示例11: createDataTableSpec

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
private DataTableSpec createDataTableSpec() throws InvalidSettingsException
{
List<String> tags=extractFields();
if(tags.isEmpty()) throw new InvalidSettingsException("No tag was defined");
DataColumnSpec cols[]=new DataColumnSpec[tags.size()*this.m_callColumns.getIncludeList().size()];
DataType t=getDataType();
int n=0;
for(String call:this.m_callColumns.getIncludeList())
	{
	for(int i=0;i< tags.size();++i)
		{
		cols[n++]=new DataColumnSpecCreator(call+":"+tags.get(i),t).createSpec();
		}
	}
return new DataTableSpec(cols);
}
 
开发者ID:lindenb,项目名称:knime4bio,代码行数:17,代码来源:ExtractFormatMultiNodeModel.java

示例12: configure

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
@Override
  protected DataTableSpec[] configure(DataTableSpec[] inSpecs)
  		throws InvalidSettingsException {
  	if(inSpecs==null || inSpecs.length!=1)
  		{
  		throw new InvalidSettingsException("Expected one table");
  		}
  	
  	DataTableSpec in=inSpecs[0];
  	int chromCol= in.findColumnIndex(m_chromCol.getColumnName());
if(chromCol==-1) throw new InvalidSettingsException("Cannot find column for chrom");
if(!(in.getColumnSpec(chromCol).getType().equals(IntCell.TYPE) ||
		in.getColumnSpec(chromCol).getType().equals(StringCell.TYPE)
   ))
	{
	throw new InvalidSettingsException("Bad type for chrom:"+in.getColumnSpec(chromCol).getType());
	}
DataTableSpec spec2= ReplacedColumnsTable.createTableSpec(in,
		new DataColumnSpecCreator(in.getColumnSpec(chromCol).getName(),StringCell.TYPE).createSpec(),
		chromCol);
  	
  	return new DataTableSpec[]{spec2};
  	}
 
开发者ID:lindenb,项目名称:knime4bio,代码行数:24,代码来源:NormalizeChromNodeModel.java

示例13: toFile

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/** Convert file location to File. Also accepts file in URL format
 * (e.g. local drop files as URL).
 * @param location The location string.
 * @return The file to the location
 * @throws InvalidSettingsException if argument is null, empty or the file
 * does not exist.
 */
public static final File toFile(final String location) throws InvalidSettingsException {
    CheckUtils.checkSetting(StringUtils.isNotEmpty(location), "Invalid (empty) jar file location");
    File result;
    URL url = null;
    try {
        url = new URL(location);
    } catch (MalformedURLException mue) {
    }
    if (url != null) {
        result = FileUtil.getFileFromURL(url);
    } else {
        result = new File(location);
    }
    CheckUtils.checkSetting(result != null && result.exists(),
            "Can't read file \"%s\"; invalid class path", location);
    return result;
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:25,代码来源:JavaSnippetUtil.java

示例14: configure

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs)
        throws InvalidSettingsException
    {
    if(inSpecs!=null && inSpecs.length!=0)
    	{
    	throw new InvalidSettingsException("Expected zero input.");
    	}
  

	return new DataTableSpec[]{
		null,
		createVcfHeaderDataColumnSpec(),
		};
	}
 
开发者ID:lindenb,项目名称:knime4bio,代码行数:19,代码来源:ReadMultiVCFNodeModel.java

示例15: getDataType

import org.knime.core.node.InvalidSettingsException; //导入依赖的package包/类
public DataType getDataType() throws InvalidSettingsException
 	{
 	if(m_dataType.getStringValue().equals("Long"))
 		{
 		return LongCell.TYPE;
 		}
 	else if(m_dataType.getStringValue().equals("Integer"))
 		{
 		return IntCell.TYPE;
 		}
 	else if(m_dataType.getStringValue().equals("Double"))
{
return DoubleCell.TYPE;
}
 	else if(m_dataType.getStringValue().equals("Boolean"))
 		{
 		return BooleanCell.TYPE;
 		}
 	return StringCell.TYPE;
 	}
 
开发者ID:lindenb,项目名称:knime4bio,代码行数:21,代码来源:ExtractFormatMultiNodeModel.java


注:本文中的org.knime.core.node.InvalidSettingsException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。