]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/GUIDExclusionFunction.java
Index tokenized lowercase versions of name and types for UI searches
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / util / GUIDExclusionFunction.java
1 /*******************************************************************************
2  * Copyright (c) 2016 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     Semantum Oy - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db.layer0.util;
13
14 import org.simantics.db.ReadGraph;
15 import org.simantics.db.Statement;
16 import org.simantics.db.layer0.util.DomainProcessor3.ExclusionDecision;
17 import org.simantics.layer0.Layer0;
18 import org.simantics.scl.runtime.function.Function1;
19
20 /**
21  * @author Antti Villberg
22  * @since 1.22
23  */
24 public class GUIDExclusionFunction implements Function1<Statement, ExclusionDecision> {
25
26         final private Layer0 L0;
27
28         public GUIDExclusionFunction(ReadGraph graph) {
29                 L0 = Layer0.getInstance(graph);
30         }
31
32         @Override
33         public ExclusionDecision apply(Statement p0) {
34                 if(L0.identifier.equals(p0.getPredicate()))
35                         return ExclusionDecision.EXCLUDE_OBJECT;
36                 else
37                         return ExclusionDecision.INCLUDE;
38         }
39
40 }