Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 17c43132d726558f3f9151d14d365ad0e7d60f98 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
 * Copyright (c) 2017 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:
 * 	Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
 */
package org.eclipse.papyrus.infra.emf.expressions.eobjectbooleanexpressions.custom;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.infra.emf.expressions.booleanexpressionspackage.impl.NotExpressionImpl;


public class CustomNotExpression extends NotExpressionImpl{
	
	@Override
	public Boolean evaluate(EObject context) {
		//1. we evaluate the own expression first
		if(null!=ownedExpression) {
			return !ownedExpression.evaluate(context);
		}
		
		//2. we evaluate the referenced expression
		if(null!=referencedExpression) {
			return !referencedExpression.evaluate(context);
		}
		
		//3. we return the default value
		return Boolean.FALSE;
	}
}

Back to the top