diff --git a/src/nodash/core/spheres/NoHashSphereDefault.java b/src/nodash/core/spheres/NoHashSphereDefault.java index 6a18cf1..c36dd7c 100644 --- a/src/nodash/core/spheres/NoHashSphereDefault.java +++ b/src/nodash/core/spheres/NoHashSphereDefault.java @@ -40,6 +40,7 @@ import nodash.models.NoUser; public final class NoHashSphereDefault implements NoHashSphereInterface { private Set database = Collections.newSetFromMap(new ConcurrentHashMap()); private String fileName; + private boolean ready = false; public NoHashSphereDefault(String fileName) { this.fileName = fileName; @@ -68,6 +69,7 @@ public final class NoHashSphereDefault implements NoHashSphereInterface { } } } + this.ready = true; } public synchronized void saveToFile() throws IOException { @@ -104,4 +106,9 @@ public final class NoHashSphereDefault implements NoHashSphereInterface { public synchronized long size() { return this.database.size(); } + + @Override + public boolean isReady() { + return this.ready; + } } diff --git a/src/nodash/core/spheres/NoHashSphereInterface.java b/src/nodash/core/spheres/NoHashSphereInterface.java index a41725f..f2d1b46 100644 --- a/src/nodash/core/spheres/NoHashSphereInterface.java +++ b/src/nodash/core/spheres/NoHashSphereInterface.java @@ -12,4 +12,5 @@ public interface NoHashSphereInterface { public void removeHash(String hash) throws IOException; public boolean checkHash(String hash); public long size(); + public boolean isReady(); }