/* * Copyright (c) 2012 Diamond Light Source Ltd. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package uk.ac.diamond.scisoft.analysis.processing.operations; import org.eclipse.dawnsci.analysis.api.fitting.functions.IFunction; import org.eclipse.dawnsci.analysis.api.processing.model.AbstractOperationModel; public class FunctionModel extends AbstractOperationModel { private IFunction function; public FunctionModel(IFunction function) { this.function = function; } public FunctionModel() { this.function = null; } public IFunction getFunction() { return function; } public void setFunction(IFunction function) { this.function = function; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((function == null) ? 0 : function.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; FunctionModel other = (FunctionModel) obj; if (function == null) { if (other.function != null) return false; } else if (!function.equals(other.function)) return false; return true; } }