Package com.vst.dto

Examples of com.vst.dto.GeoTreeItemDto


    Map<Integer, GeoTreeItemDto> idxMacroReg = new HashMap<Integer, GeoTreeItemDto>();
    Map<Integer, GeoTreeItemDto> idxProvince = new HashMap<Integer, GeoTreeItemDto>();
    Map<Integer, GeoTreeItemDto> idxCity = new HashMap<Integer, GeoTreeItemDto>();

    GeoClassificator russia = null;
    GeoTreeItemDto res = null;
    for (GeoClassificator item : geolist) {
      if (item instanceof GeoCountry) {
        idxCountry.put(item.getId(), new GeoTreeItemDto(item));
        if (item.getLatinName().equalsIgnoreCase("russia")) {
          russia = item;
        }
      } else if (item instanceof GeoMacroRegion) {
        idxMacroReg.put(item.getId(), new GeoTreeItemDto(item));
      } else if (item instanceof GeoProvince) {
        idxProvince.put(item.getId(), new GeoTreeItemDto(item));
      } else if (item instanceof GeoCity) {
        idxCity.put(item.getId(), new GeoTreeItemDto(item));
      }
    }

    for (GeoTreeItemDto item : idxCity.values()){
      GeoClassificator dbitem = item.getGeoItem();
      GeoTreeItemDto parent = idxProvince.get(dbitem.getParent().getId());
      if (parent != null){
        parent.addChild(item);
      }
    }

    for (GeoTreeItemDto item : idxProvince.values()){
      GeoClassificator dbitem = item.getGeoItem();
      GeoTreeItemDto parent = idxMacroReg.get(dbitem.getParent().getId());
      if (parent != null){
        parent.addChild(item);
      }
    }

    for (GeoTreeItemDto item : idxMacroReg.values()){
      GeoClassificator dbitem = item.getGeoItem();
      GeoTreeItemDto parent = idxCountry.get(dbitem.getParent().getId());
      if (parent != null){
        parent.addChild(item);
      }
    }

    if (russia != null) {
      res = idxCountry.get(russia.getId());
View Full Code Here

TOP

Related Classes of com.vst.dto.GeoTreeItemDto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.