Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #8633

Re: Support Map<String, String> & Map<String, MyString>

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Support Map<String, String> & Map<String, MyString>
Date 2011-10-07 10:48 -0700
Organization Canadian Mind Products
Message-ID <3heu87dhdoq9ehsireerf0dovnkp0oorbp@4ax.com> (permalink)
References <dbb47bbb-1583-4b6d-a769-833fe220f9f3@5g2000yqo.googlegroups.com> <p6it871e133n8fpbdarnuu58pss77h1j9p@4ax.com> <4d229842-c018-471a-b465-466221ba5aa0@n12g2000yqh.googlegroups.com>

Show all headers | View raw


On Fri, 7 Oct 2011 03:49:35 -0700 (PDT), albert kao
<albertkao3@gmail.com> wrote, quoted or indirectly quoted someone who
said :

>I look at http://mindprod.com/jgloss/delegate.html but still don't
>know how to apply it to my situation.
>Would you mind posting some source codes?

What you do is in your class have something like this:

HashtMap<String,Thing> map1;
HashMap<String,String> map2;

public Map getMap1() { return map1; }
public Map getMay2() { return map2; }

Or you don't expose the raw Maps, but just offer a few wrapper methods
that call methods on your two maps.

public boolean put1( String s, Thing t)
{
 return map1.put( s, t );
}
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
It should not be considered an error when the user starts something
already started or stops something already stopped. This applies
to browsers, services, editors... It is inexcusable to 
punish the user by requiring some elaborate sequence to atone,
e.g. open the task editor, find and kill some processes.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar


Thread

Support Map<String, String> & Map<String, MyString> albert kao <albertkao3@gmail.com> - 2011-10-06 12:05 -0700
  Re: Support Map<String, String> & Map<String, MyString> Lew <lewbloch@gmail.com> - 2011-10-06 13:02 -0700
    Re: Support Map<String, String> & Map<String, MyString> Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-10-06 13:23 -0700
      Re: Support Map<String, String> & Map<String, MyString> albert kao <albertkao3@gmail.com> - 2011-10-06 14:07 -0700
        Re: Support Map<String, String> & Map<String, MyString> Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-10-06 15:42 -0700
          Re: Support Map<String, String> & Map<String, MyString> albert kao <albertkao3@gmail.com> - 2011-10-06 17:54 -0700
          Re: Support Map<String, String> & Map<String, MyString> albert kao <albertkao3@gmail.com> - 2011-10-06 18:09 -0700
    Re: Support Map<String, String> & Map<String, MyString> albert kao <albertkao3@gmail.com> - 2011-10-06 13:32 -0700
      Re: Support Map<String, String> & Map<String, MyString> Lew <lewbloch@gmail.com> - 2011-10-06 19:03 -0700
        Re: Support Map<String, String> & Map<String, MyString> albert kao <albertkao3@gmail.com> - 2011-10-06 20:33 -0700
  Re: Support Map<String, String> & Map<String, MyString> Roedy Green <see_website@mindprod.com.invalid> - 2011-10-07 02:41 -0700
    Re: Support Map<String, String> & Map<String, MyString> albert kao <albertkao3@gmail.com> - 2011-10-07 03:49 -0700
      Re: Support Map<String, String> & Map<String, MyString> Roedy Green <see_website@mindprod.com.invalid> - 2011-10-07 10:48 -0700

csiph-web