readresultfile.java

来自「基于Java的地图数据管理软件。使用MySQL数据库管理系统。」· Java 代码 · 共 74 行

JAVA
74
字号
package net.aetherial.gis.our.duibi.readXLS;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class ReadResultFile extends ReadFile{
  private int emtyrow = 0;
  public ReadResultFile(String fileName) {
    this.setSheet(fileName,"Sheet1");
    this.baseRow = 2;
    this.row = this.baseRow;
  }
  public String getBianma(){
    try {
      return this.rowData[2].getContents();
    }
    catch (Exception ex) {
      return "";
    }
  }

  public String getShi(){
    try {
      return this.rowData[0].getContents();
    }
    catch (Exception ex) {
      return "";
    }
  }

  public String getXian(){
    try {
      return this.rowData[1].getContents();
    }
    catch (Exception ex) {
      return "";
    }
  }


  public boolean isEmptyrow(){
    if ((emtyrow >1000) && super.isEmptyrow()) {
      return true;
    }else if(super.isEmptyrow()){
      emtyrow++;
      return false;
    }else{
      emtyrow = 0;
      return false;
    }
  }

  public static void main(String args[]){
    String n = "";
    ReadResultFile rf = new ReadResultFile("E:\\GIS\\各市GPS测量与年报数据比较\\安庆市.xls");
    while (true) {
      rf.moveNext();
      if (rf.isEmptyrow()) {

      }
    }
  }

}

⌨️ 快捷键说明

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