From 7a0f94dbdea4e42050d528021097fdb005ccc617 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 15 Dec 2019 17:45:04 +0000 Subject: [PATCH] Convert elements and partitions to properties --- util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt | 5 +++-- .../java/dev/openrs2/util/collect/ForestDisjointSet.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt b/util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt index 02477834..1b90cdb1 100644 --- a/util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt +++ b/util/src/main/java/dev/openrs2/util/collect/DisjointSet.kt @@ -3,9 +3,10 @@ package dev.openrs2.util.collect interface DisjointSet : Iterable> { interface Partition : Iterable + val elements: Int + val partitions: Int + fun add(x: T): Partition operator fun get(x: T): Partition? fun union(x: Partition, y: Partition) - fun elements(): Int - fun partitions(): Int } diff --git a/util/src/main/java/dev/openrs2/util/collect/ForestDisjointSet.java b/util/src/main/java/dev/openrs2/util/collect/ForestDisjointSet.java index 96affc7f..167352ba 100644 --- a/util/src/main/java/dev/openrs2/util/collect/ForestDisjointSet.java +++ b/util/src/main/java/dev/openrs2/util/collect/ForestDisjointSet.java @@ -154,12 +154,12 @@ public final class ForestDisjointSet implements DisjointSet { } @Override - public int elements() { + public int getElements() { return elements; } @Override - public int partitions() { + public int getPartitions() { return partitions; }