From 67efd14c6d099733a775a0fa5d27c748d34c9d22 Mon Sep 17 00:00:00 2001 From: Mateusz Ujma Date: Mon, 5 Aug 2013 00:29:53 +0000 Subject: [PATCH] Added constructor to the IndexedSet with a comparator git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@7221 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/explicit/IndexedSet.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/prism/src/explicit/IndexedSet.java b/prism/src/explicit/IndexedSet.java index b2a0f0e3..a72336b3 100644 --- a/prism/src/explicit/IndexedSet.java +++ b/prism/src/explicit/IndexedSet.java @@ -39,13 +39,19 @@ public class IndexedSet implements StateStorage public IndexedSet() { - this(false); + indexOfLastAdd = -1; } public IndexedSet(boolean sorted) { + this(); set = sorted ? new TreeMap() : new HashMap(); - indexOfLastAdd = -1; + } + + public IndexedSet(Comparator comparator) + { + this(); + set = new TreeMap(comparator); } @Override