From: Marko Luukkainen Date: Tue, 29 Jan 2019 11:06:53 +0000 (+0200) Subject: Rename linked list functions that are overlapping or are too generic X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=b56d6b93d1225ac4b65db8e0fc56515eb1eef42f;p=simantics%2Fplatform.git Rename linked list functions that are overlapping or are too generic gitlab #250 Change-Id: Iae2e7ffc420970cb52c85c391361f02da3be3f28 (cherry picked from commit 0f1223c3cce41690160216eb1ec7be38f7bf4571) --- diff --git a/bundles/org.simantics.scl.db/scl/Simantics/DB.md b/bundles/org.simantics.scl.db/scl/Simantics/DB.md index 81ee3b6d8..d51ecddd8 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/DB.md +++ b/bundles/org.simantics.scl.db/scl/Simantics/DB.md @@ -70,6 +70,12 @@ ::value[elementsOfOrderedSet] ::value[parentOrderedSet] +## Linked List + +::value[elementsOfList,createList,createListWithType] +::value[insertListBack,insertListFront,removeListElement] +::value[swapListElementWithPrevious,swapListElementWithNext] + ## Transactions ::value[syncRead, asyncRead] diff --git a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl index adc72bb94..af8c19476 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl +++ b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl @@ -305,26 +305,35 @@ importJava "org.simantics.db.common.utils.OrderedSetUtils" where elementsOfOrderedSet :: Resource -> [Resource] importJava "org.simantics.db.common.utils.ListUtils" where + "`elementsOfList l` returns elements of list `l`" @JavaName toList elementsOfList :: Resource -> [Resource] + "`createList [e]` creates a new list containing elements `[e]`" @JavaName create createList :: [Resource] -> Resource + "`createListWithType t [e]` creates a new list with type `t` containing elements `[e]`" @JavaName create createListWithType :: Resource -> [Resource] -> Resource - @javaName insertBack - insertBack :: Resource -> [Resource] -> () + "`insertListBack l [e]` inserts elements `[e]` back to the list `l`" + @JavaName insertBack + insertListBack :: Resource -> [Resource] -> () - @javaName removeElement - removeElement :: Resource -> Resource -> Boolean + "`insertListFront l [e]` inserts elements `[e]` front of the list `l`" + @JavaName insertFront + insertListFront :: Resource -> [Resource] -> () - @javaName swapWithPrevious - swapWithPrevious :: Resource -> Resource -> Boolean + "`removeListElement l e` removes a element `e` from the list `l`" + @JavaName removeElement + removeListElement :: Resource -> Resource -> Boolean + + @JavaName swapWithPrevious + swapListElementWithPrevious :: Resource -> Resource -> Boolean - @javaName swapWithNext - swapWithNext :: Resource -> Resource -> Boolean + @JavaName swapWithNext + swapListElementWithNext :: Resource -> Resource -> Boolean importJava "org.simantics.db.common.utils.CommonDBUtils" where