From: Hannu Niemistö Date: Mon, 14 Aug 2017 11:46:28 +0000 (+0300) Subject: (refs #7428) Added predicatesOf function to Simantics/DB X-Git-Tag: v1.31.0~245^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=293ccfa5eb545cf7c541703a5747d85da662ec27;p=simantics%2Fplatform.git (refs #7428) Added predicatesOf function to Simantics/DB Change-Id: I77e4962373d9fbea81fab37fd5b59ee434133eb3 --- diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/IntSet.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/IntSet.java index a84f8fc55..7c32b8e59 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/IntSet.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/IntSet.java @@ -37,6 +37,8 @@ final public class IntSet implements ResourceSet { protected static final int DEFAULT_CAPACITY = 3; public static final int NO_DATA = -1; + + private static final Object[] EMPTY_ARRAY = new Object[0]; public IntSet() { support = null; @@ -241,7 +243,16 @@ final public class IntSet implements ResourceSet { @Override public Object[] toArray() { - throw new UnsupportedOperationException(); + if(data != null) { + Object[] result = new Object[sizeOrData]; + for(int i=0;i Resource -> Boolean getRootLibrary :: () -> Resource + + @JavaName getPredicates + predicatesOf :: Resource -> [Resource] importJava "org.simantics.db.layer0.util.ExtendedUris" where "Converts an absolute URI to a resource" @@ -477,4 +480,4 @@ possibleChildWithPath parent path = Just c -> possibleChild c name Nothing -> Nothing ) - (Just parent) path + (Just parent) path \ No newline at end of file