swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: printing lists (java)


From: Marcus G. Daniels
Subject: Re: printing lists (java)
Date: 23 Mar 2001 10:10:48 -0800
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "MR" == Matteo Richiardi <address@hidden> writes:

MR> I've tried to use two methods: the first one follows the TestIndex
MR> example, but still I'm not able to make it work (there is a conversion
MR> problem I would like to know more about...); the second one is an
MR> attempt to use the forEachKey() method. I know there are many things
MR> that go wrong there, any comments from you will be welcomed.

MR>  while ((keyObj = mapIndex.next ()) != null)

Here what you get from `next' is the value, not the key.
You'd have to use mapIndex.getKey () for that.

MR> ListImpl kList;

You are re-declaring this several times.  If you want to re-use
the `kList' symbol, wrap the relevant context in {}.

MR> map.forEachKey(kList, sel);

The usage here should be map.forEach (sel).  However, you can't send
printList to these values because the Selector must be on the values.
In other words, the printList would have to be a public instance
method on a List, and it isn't -- you have it as a static.  It would
work to use a Selector like this:

            sel = new Selector(ListImpl.class, "xfprint", false);


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]