Accessing a vriable by 3 threads in java
===

I have a class that has three threads and a hashmap that stores data. one of the threads writes data to hashmap and two other reads it. something like this

    public static class collector{
      Thread writter;
      Thread reader1;
      Thread reader2;
      HashMap storage;
      ...
      public void write(String s){
        storage.put(s.hashcode(),s);
      }
      public String read(long hash){
        return storage.get(hash);
      }
      public Set readAll(){
        return storage.entrySet();
      }
    }

I want the first thread (writter) run the first method (write). and reader1 run read and reader 2 run readAll. but I couldn't find anyway to access storage in threads (run method). how can I write threads to run like these 3 methods and all have access to storage in same time?
