SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.pmm.nodes/src/de/bund/bfr/knime/pmm/js/modelplotter/ModelPlotterViewRepresentation.java

Summary

Maintainability
A
1 hr
Test Coverage
/*******************************************************************************
 * Copyright (c) 2015 Federal Institute for Risk Assessment (BfR), Germany
 *
 * 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 3 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, see <http://www.gnu.org/licenses/>.
 *
 * Contributors:
 *     Department Biological Safety - BfR
 *******************************************************************************/
package de.bund.bfr.knime.pmm.js.modelplotter;

import java.util.Random;

import org.knime.core.node.InvalidSettingsException;
import org.knime.core.node.NodeSettingsRO;
import org.knime.core.node.NodeSettingsWO;
import org.knime.js.core.JSONViewContent;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonTypeInfo;


/**
* JavaScript view representation, contains all data of the plotable function, such as function 
* expression, argumants, and constants. 
*
* @author Kilian Thiel, KNIME.com GmbH, Berlin, Germany
* 
* HINT: This class does not yet serve any purpose.
*/
@JsonAutoDetect
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
public final class ModelPlotterViewRepresentation extends JSONViewContent {

    // no members to hash on
    public final int pseudoIdentifier = (new Random()).nextInt();
    
    @Override
    public void saveToNodeSettings(NodeSettingsWO settings) {
        // Nothing to do.
    }

    @Override
    public void loadFromNodeSettings(NodeSettingsRO settings)
            throws InvalidSettingsException {
        // Nothing to do.
    }
    
    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        return pseudoIdentifier;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(final Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        if (obj.getClass() != getClass()) {
            return false;
        }
        return false; // maybe add other criteria here
    }
}