⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readjianzhicun.java

📁 基于Java的地图数据管理软件。使用MySQL数据库管理系统。
💻 JAVA
字号:
package net.aetherial.gis.jiaotongbu.outputJTB.txtOutput.module.excel;

import jxl.Sheet;
import jxl.NumberCell;
/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class ReadJianzhicun extends ReadRecord{
  public ReadJianzhicun(Sheet sheet) {
    super(sheet);
    /**
     * 乡镇的数据起点行为第4行.
     */
    this.baseRow = Property.t2_Jianzhicun_Base_Row;
    this.setRow(0);
  }

   /**
    * 取 @param xiangzhenName 乡镇名称 的值
    */
   public String getXiangzhenName(){
     String result = rowData[1].getContents().trim();
     if(result.length() > 2){
       result = result.replaceAll("镇","").replaceAll("乡","");
     }
       return result;
   }

   /**
    * 取 @param jzcName 建制村名称 的值
    */
   public String getJzcName(){
       return rowData[2].getContents().trim();
   }

   /**
    * 取 @param jzcBianma 建制村编码 的值
    */
   public String getJzcBianma(){
     System.out.println("row:" + this.row + ",rowData.length:" + rowData.length);
       return rowData[11].getContents().trim();
   }

   /**
    * 取 @param jzcLongitude 建制村经度 的值
    */
   public String getJzcLongitude(){
     if (this.getJzcCompareWithMinzhen().equals("没有测量的行政村")) {
       return "118.88888888";
     }
     else {
//       System.out.println("row:" + this.row);
       NumberCell result = null;
      try {
        result = (NumberCell) rowData[4];
        return result.getValue()+"";
      }
      catch (Exception ex) {
        return "";
      }

//       return rowData[4].getContents().trim();
     }
   }

   /**
    * 取 @param jzcLatitude 建制村纬度 的值
    */
   public String getJzcLatitude(){
     if (this.getJzcCompareWithMinzhen().equals("没有测量的行政村")) {
      return "31.88888888";
    }else{
      NumberCell result = null;
      try {
        result = (NumberCell) rowData[5];
        return result.getValue()+"";
      }
      catch (Exception ex) {
        return "";
      }


    }
   }

   /**
    * 取 @param jzcAltitude 建制村高程 的值
    */
   public String getJzcAltitude(){
       return rowData[6].getContents().trim();
   }

   /**
    * 取 @param jzcCompareWithMinzhen 建制村与民政局数据比较 的值
    */
   public String getJzcCompareWithMinzhen(){
       return rowData[7].getContents().trim();
   }

   /**
    * 取 @param jzcRenkou 建制村与民政局数据比较 的值
    */
   public String getJzcRenkou(){
       return rowData[8].getContents().trim();
   }

   /**
    * 取 @param jzcZRC 建制村所辖自然村数量 的值
    */
   public String getJzcZRC(){
       return rowData[9].getContents().trim();
   }

   /**
    * 取 @param jzcDixing 建制村所属地形 的值
    */
   public String getJzcDixing(){
     String dixing = rowData[10].getContents().trim();
     if(dixing == null) dixing = "1";
     if("12345".indexOf(dixing) > -1){
        return dixing;
      }

     if ((dixing.indexOf("平原") != -1)||(dixing.indexOf("微丘") != -1)||(dixing.indexOf("丘陵") != -1)) {
       return 1+"";
     }
     else if ((dixing.indexOf("山岭") != -1)||(dixing.indexOf("重丘") != -1)) {
       return 2+"";
     }
     else if(dixing.indexOf("岛屿") != -1){
       return 3+"";
     }else{
       return ""+1;
     }
   }

   /**
    * 取 @param jzcHaveMatou 建制村岛屿是否建有陆岛交通码头 的值
    */
   public String getJzcHaveMatou(){
       return rowData[12].getContents().trim();
   }

   /**
    * 取 @param jzcMatouDis 建制村码头与陆地距离(公里) 的值
    */
   public String getJzcMatouDis(){
       return rowData[13].getContents().trim();
   }

   /**
    * 取 @param jzcHaveRoad 建制村岛内是否建有公路 的值
    */
   public String getJzcHaveRoad(){
       return rowData[14].getContents().trim();
   }

   /**
    * 取 @param jzcIsSuitable 建制村是否适宜通公路 的值
    */
   public String getJzcIsSuitable(){
     String reason = rowData[15].getContents().trim();
     if (reason.equals("")) {
       return "1";
     }
     else {
       return "2";
     }
   }

   /**
    * 取 @param jzcReason 建制村不适宜原因 的值
    */
   public String getJzcReason(){
       return rowData[16].getContents().trim();
   }

   /**
    * 取 @param jzcBeizhu 建制村备注 的值
    */
   public String getJzcBeizhu(){
     try{
       return rowData[17].getContents().trim().replaceAll("\\r","").replaceAll("\\n","");
     }catch(Exception e){
       return "";
     }
   }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -