[OpenMap Users] Possible error is BasicGeometry.putAttribute() or BasicGeometry.getAttribute()

From: David Ward <mry_yachtsman@hotmail.com>
Date: Thu Apr 14 2005 - 03:23:00 EDT

Don,

I ran into a problem with the behaviour of putAttribute() getAttribute()
methods. When putting a key value pair, the first assignment will be
"forgotten" when a subsequent (but different) put is made.

Took a peek at the put/get attribute code in BasicGeometry and see how it
seemes to be implemented for backward compatibility with get/put AppObject.
However, I didn't see where what might be causing the behaviour.

Here is some test code to illustrate the behaviour:

public class OpenMapTestPutAttribute {
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        OMLine line = new OMLine();

        System.out.println("Putting name:firstname on line");
        line.putAttribute("name", "firstname");
        System.out.printf(" line.getAttribute(\"name\") is %-12s <== this
is expected\n",line.getAttribute("name"));
        System.out.printf(" line.getAttribute(\"slide\") is %-12s <== is
null as expected, not yet assigned\n",line.getAttribute("slide"));

        System.out.println("Putting slide:slidetype on line");
        line.putAttribute("slide", "slidetype");
        System.out.printf(" line.getAttribute(\"name\") is %-12s <==
should be firstname not null\n",line.getAttribute("name"));
        System.out.printf(" line.getAttribute(\"slide\") is %-12s <== is
slidetype as expected\n",line.getAttribute("slide"));

        System.out.println("Putting name:firstname on line (again)");
        line.putAttribute("name", "firstname");
        System.out.printf(" line.getAttribute(\"name\") is %-12s <== now
it is firstname after second put\n",line.getAttribute("name"));
        System.out.printf(" line.getAttribute(\"slide\") is %-12s <== is
slidetype as expected\n",line.getAttribute("slide"));
    }
}

Cheers,
David

-----------------
David J. Ward
mry_yachtsman@hotmail.com

>From: "Mr, BADER MOHAMMAD HALAWANI" <st202475@ccse.kfupm.edu.sa>
>To: <openmap-users@bbn.com>
>Subject: [OpenMap Users] multiRoadLayer ??
>Date: Thu, 14 Apr 2005 02:08:49 +0300
>
>
>hi all,
>
>could any one explain for me how MultiRoadLayer class can be used and how
>it
>is programmed??
>
>for the parameter that is passed to FindRoadOnPath what is the kind of
>information or classes the list should contain??
>
>note that I am using ESRI plugin as my main maps??
>
>
>THANKS' ALOT.
>______________________________
>BADER MOHAMMAD HASSAN HALAWANI
>KING FAHAD UNIVERSIITY FOR PETROLEUM & MINERALS
>COMPUTER ENGINEERING DEPATMENT
>
>--
>[To unsubscribe to this list send an email to "majdart@bbn.com"
>with the following text in the BODY of the message "unsubscribe
>openmap-users"]

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Apr 14 03:24:31 2005

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:41 EDT