| /******************************************************************************* |
| * Copyright (c) 2016 ALL4TEC & CEA LIST. |
| * 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 |
| * |
| * Contributors: |
| * ALL4TEC & CEA LIST - initial API and implementation |
| ******************************************************************************/ |
| package org.polarsys.esf.localanalysis.profile.tools.util; |
| |
| import java.util.Set; |
| |
| import org.polarsys.esf.esflocalanalysis.IAbstractSFailureModeLAnalysis; |
| import org.polarsys.esf.esflocalanalysis.IAbstractSLocalAnalysisElement; |
| import org.polarsys.esf.esflocalanalysis.ISFearedEventsFamily; |
| |
| /** |
| * Interface which offers facilities about Library items. |
| * |
| * @author $Author: jdumont $ |
| * @version $Revision: 83 $ |
| */ |
| public interface IFearedEventItemUtils { |
| |
| /** |
| * Set the selected status. |
| * |
| * WARNING : concrete type of pObject must be {@link FearedEvent} or {@link FearedEventsFamily} |
| * |
| * @param pObject Target for which selected status will be modified |
| * @param pValue The value to set |
| */ |
| void setSelected(IAbstractSLocalAnalysisElement pObject, boolean pValue); |
| |
| /** |
| * Get if current item is selected. |
| * |
| * WARNING : concrete type of pObject must be {@link FearedEvent} or {@link FearedEventsFamily} |
| * |
| * @param pObject Object for which selected status is computed |
| * @return The selected status |
| */ |
| boolean isSelected(IAbstractSLocalAnalysisElement pObject); |
| |
| /** |
| * Get associated failure modes with <b>selected</b> feared events library items. |
| * |
| * @param pFearedEventItem Root element where exploration begin |
| * @return Set of found failure modes |
| */ |
| Set<IAbstractSFailureModeLAnalysis> getFailureModesForPropagation(IAbstractSLocalAnalysisElement pFearedEventItem); |
| |
| /** |
| * Recursive method which check if a family contains at least one feared event, |
| * or one non empty sub family. In these case, the given family is not considered as empty. |
| * |
| * @param pFamily The family to check |
| * @return <code>true</code> if the given family is empty |
| */ |
| boolean isFamilyEmpty(final ISFearedEventsFamily pFamily); |
| |
| } |