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

📄 arrayfile.java

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

import net.aetherial.gis.table.WuWei;
import java.util.Vector;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class ArrayFile {
  public WuWei array = new WuWei();
  public ArrayFile() {
  }

  /**
   * 得到建制村的数目
   *
   */
  public int getJianzhicunNum(String xiangzhenName){

    Vector result = new Vector();
    String shortName = xiangzhenName;
    if(shortName.length() > 2){
      shortName = shortName.
          replaceAll("镇","").
          replaceAll("乡","").
          replaceAll("办事处","").
          replaceAll("街道","");
    }
    String shortName1 = xiangzhenName;


    for (int i = 0; i < this.array.wuwei_cun.length; i++) {
       shortName1 = this.array.wuchen_xiangzhen[i];
      if(shortName1.length() > 2){
          shortName1 = shortName1.
              replaceAll("镇","").
              replaceAll("乡","").
              replaceAll("办事处","").
              replaceAll("街道","");
        }

      if (shortName.equals(shortName1)){//.xiangzhenName.indexOf(this.array.wuchen_xiangzhen[i]) == 0 || this.array.wuchen_xiangzhen[i].indexOf(xiangzhenName) == 0) {
        boolean alreadyInserted = false;
        for(int j = 0; j<result.size(); j++){
          String entry = (String) result.get(j);
          if(entry.equals(this.array.wuwei_cun[i])){
            alreadyInserted = true;
            break;
          }
        }
        if(!alreadyInserted) result.add(this.array.wuwei_cun[i]);
      }
    }
    return result.size();
  }

  public static void main(String ag[]){
    ArrayFile array = new ArrayFile();
    System.out.println(array.getJianzhicunNum("荻港"));
  }
}

⌨️ 快捷键说明

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