From c0836e11f6b21cce5dbad0c679683a623c4c78c3 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 15 Dec 2019 17:07:00 +0000 Subject: [PATCH] Convert DisjointSet to Kotlin --- .../java/dev/openrs2/util/collect/DisjointSet.java | 13 ------------- .../java/dev/openrs2/util/collect/DisjointSet.kt | 11 +++++++++++ 2 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 util/src/main/java/dev/openrs2/util/collect/DisjointSet.java create mode 100644 util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt diff --git a/util/src/main/java/dev/openrs2/util/collect/DisjointSet.java b/util/src/main/java/dev/openrs2/util/collect/DisjointSet.java deleted file mode 100644 index 29861640..00000000 --- a/util/src/main/java/dev/openrs2/util/collect/DisjointSet.java +++ /dev/null @@ -1,13 +0,0 @@ -package dev.openrs2.util.collect; - -public interface DisjointSet extends Iterable> { - interface Partition extends Iterable { - /* empty */ - } - - Partition add(T x); - Partition get(T x); - void union(Partition x, Partition y); - int elements(); - int partitions(); -} diff --git a/util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt b/util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt new file mode 100644 index 00000000..02477834 --- /dev/null +++ b/util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt @@ -0,0 +1,11 @@ +package dev.openrs2.util.collect + +interface DisjointSet : Iterable> { + interface Partition : Iterable + + fun add(x: T): Partition + operator fun get(x: T): Partition? + fun union(x: Partition, y: Partition) + fun elements(): Int + fun partitions(): Int +}