From bea31f340e507e201d64fdad2f9da626b2a06955 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Sun, 11 Jan 2015 15:15:52 -0800 Subject: [PATCH] Added API to get the complete list of claims. Returned list is read-only. --- src/me/ryanhamshire/GriefPrevention/DataStore.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/me/ryanhamshire/GriefPrevention/DataStore.java b/src/me/ryanhamshire/GriefPrevention/DataStore.java index 6f19c3c..4dfd154 100644 --- a/src/me/ryanhamshire/GriefPrevention/DataStore.java +++ b/src/me/ryanhamshire/GriefPrevention/DataStore.java @@ -593,6 +593,14 @@ public abstract class DataStore return null; } + //returns a read-only access point for the list of all land claims + //if you need to make changes, use provided methods like .deleteClaim() and .createClaim(). + //this will ensure primary memory (RAM) and secondary memory (disk, database) stay in sync + public Collection getClaims() + { + return Collections.unmodifiableCollection(this.claims); + } + //gets a unique, persistent identifier string for a chunk private String getChunkString(Location location) {