| package org.eclipse.stem.core.predicate.impl; |
| |
| /******************************************************************************* |
| * Copyright (c) 2008 IBM Corporation and others. |
| * 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: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.stem.core.model.STEMTime; |
| import org.eclipse.stem.core.predicate.Or; |
| import org.eclipse.stem.core.predicate.Predicate; |
| import org.eclipse.stem.core.predicate.PredicatePackage; |
| import org.eclipse.stem.core.graph.Graph; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Or</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * </p> |
| * |
| * @generated |
| */ |
| public class OrImpl extends NaryBooleanOperatorImpl implements Or { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected OrImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return PredicatePackage.Literals.OR; |
| } |
| |
| /** |
| * @see org.eclipse.stem.core.predicate.impl.PredicateImpl#evaluate(org.eclipse.stem.core.model.STEMTime, long, org.eclipse.stem.core.model.Decorator) |
| */ |
| @Override |
| public boolean evaluate(STEMTime time, long timerPeriod, Graph graph) { |
| boolean retValue = false; |
| for (Predicate predicate : getOperands()) { |
| retValue = predicate.evaluate(time, timerPeriod, graph); |
| // One is true? |
| if (retValue) { |
| // Yes |
| break; |
| } // if |
| } // for each Predicate |
| return retValue; |
| } // evaluate |
| |
| |
| } //OrImpl |