All pastes #590912 Raw Edit

Untitled

public text v1 · immutable
#590912 ·published 2007-06-26 21:08 UTC
rendered paste body
	private void parseDocument(Document doc)
	{
        for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
        {
            if ("zones".equalsIgnoreCase(n.getNodeName()))
            {
            	for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
            	{
            		if ("zone".equalsIgnoreCase(d.getNodeName()))
            		{
						L2Zone zone = new L2Zone(d);
						
						if (zone != null)
						{
							List<L2Zone> zonelist;
							
							if (_zones.containsKey(zone.getZoneType()))
								zonelist = _zones.get(zone.getZoneType());
							else
								zonelist = new FastList<L2Zone>();
							
							zonelist.add(zone);
							
							if (!_zones.containsKey(zone.getZoneType()))
								_zones.put(zone.getZoneType(), zonelist);								
						}
            		}
            	}
            }
        }
	}