From 293ccfa5eb545cf7c541703a5747d85da662ec27 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Mon, 14 Aug 2017 14:46:28 +0300 Subject: [PATCH] (refs #7428) Added predicatesOf function to Simantics/DB Change-Id: I77e4962373d9fbea81fab37fd5b59ee434133eb3 --- .../src/org/simantics/db/impl/query/IntSet.java | 13 ++++++++++++- bundles/org.simantics.scl.db/scl/Simantics/DB.scl | 5 ++++- 2 files changed, 16 insertions(+), 2 deletions(-) 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 -- 2.47.1