コード例 #1
0
 public String[] buldingbean2StringArray(BuldingBean bean) {
   String[] strings = new String[4];
   strings[0] = bean.getId();
   strings[1] = Double.toString(bean.getArea());
   strings[2] = Double.toString(bean.getBaseElectric());
   strings[3] = Double.toString(bean.getAirElectric());
   return strings;
 }
コード例 #2
0
  public List<BuldingBean> generateSamples(
      List<BuldingBean> buldingBeans, List<AreaBean> areaBeans) {
    // TODO Auto-generated method stub
    List<BuldingBean> samples = new ArrayList<BuldingBean>();

    Map<String, Double> map = new HashMap<String, Double>();
    for (int i = 0; i < areaBeans.size(); i++) {
      map.put(areaBeans.get(i).getObjectId(), areaBeans.get(i).getArea());
    }
    Set<String> keySet = map.keySet();

    BuldingBean tmp = null;
    String tmpKey = null;
    for (int i = 0; i < buldingBeans.size(); i++) {
      tmp = buldingBeans.get(i);
      tmpKey = tmp.getId();
      if (!keySet.contains(tmpKey)) {
        continue;
      }
      tmp.setArea(map.get(tmpKey));
      samples.add(tmp);
    }
    return samples;
  }