X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.graph%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fstore%2FPathPattern.java;fp=bundles%2Forg.simantics.graph%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fstore%2FPathPattern.java;h=f708f3506b2091763017dfa0092de0bf21c1c7ed;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=347b42b8058423de5ea3102aeaab4888bdefcf4d;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.graph/src/org/simantics/graph/store/PathPattern.java b/bundles/org.simantics.graph/src/org/simantics/graph/store/PathPattern.java index 347b42b80..f708f3506 100644 --- a/bundles/org.simantics.graph/src/org/simantics/graph/store/PathPattern.java +++ b/bundles/org.simantics.graph/src/org/simantics/graph/store/PathPattern.java @@ -1,117 +1,117 @@ -package org.simantics.graph.store; - -import gnu.trove.set.hash.THashSet; - -import java.util.regex.Pattern; - -import org.simantics.graph.query.Path; -import org.simantics.graph.query.PathChild; -import org.simantics.graph.query.Paths; - -public class PathPattern { - - private static PathPattern EMPTY_PATTERN = new PathPattern(null, null); - - Path prefix; - Pattern suffix; - - private PathPattern(Path prefix, Pattern suffix) { - this.prefix = prefix; - this.suffix = suffix; - } - - public static PathPattern compile(String pattern) { - pattern = stripPatternPrefix(pattern); - if(pattern == null) - return EMPTY_PATTERN; - String[] parts = pattern.split("/"); - - Path path = Paths.Root; - for(int i=0;i result) { - int id = store.pathToId(prefix); - if(id == -1) - return; - store.findChildren(id, prefix, "", suffix, result); - } - - public static void main(String[] args) { - System.out.println(compile("http://www.simantics.org/*/foo")); - } -} +package org.simantics.graph.store; + +import gnu.trove.set.hash.THashSet; + +import java.util.regex.Pattern; + +import org.simantics.graph.query.Path; +import org.simantics.graph.query.PathChild; +import org.simantics.graph.query.Paths; + +public class PathPattern { + + private static PathPattern EMPTY_PATTERN = new PathPattern(null, null); + + Path prefix; + Pattern suffix; + + private PathPattern(Path prefix, Pattern suffix) { + this.prefix = prefix; + this.suffix = suffix; + } + + public static PathPattern compile(String pattern) { + pattern = stripPatternPrefix(pattern); + if(pattern == null) + return EMPTY_PATTERN; + String[] parts = pattern.split("/"); + + Path path = Paths.Root; + for(int i=0;i result) { + int id = store.pathToId(prefix); + if(id == -1) + return; + store.findChildren(id, prefix, "", suffix, result); + } + + public static void main(String[] args) { + System.out.println(compile("http://www.simantics.org/*/foo")); + } +}