Linked List Example

The following information pertains to marshalling instances of java.util.LinkedList.

Sample Code

        /**
         * Mostly this test ensures that an infinite loop of some kind doesn't
         * occur, since many of the Objects held by a LinkedList point to internal
         * structures held by it.
         * 
         * @throws Exception
         */
        public void testLinkedList() throws Exception {
                Marshaller marshaller = new Marshaller(
                                Marshaller.FQCN_NEVER, Marshaller.SHOW_ACTUAL_TYPE);

                LinkedList list = new LinkedList();
                list.add("one");
                list.add("two");
                list.add("three");
                Map map = marshaller.marshal(list);

                BufferedWriter bw = new BufferedWriter(new FileWriter("c:\\temp\\linked-list.mm"));
                map.marshal(bw);
                bw.close();
        }
        

Image Representation

The following image was created by taking a screenshot of a simplified version of the map.

FreeMind MindMap Representation