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

📄 readrecord.java

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

import jxl.Sheet;
import jxl.Cell;
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 ReadRecord {
  /**
   * 数据所在的工作表Sheet
   */
  protected Sheet mySheet = null;

  /**
   * 记录所读取的行
   */
  protected int row = 0;

  /**
   * 行数据(不是表格抬头部分)的第一行,所在的位置(行)
   */
  protected int baseRow = 0;
  /**
   *
   */
  protected Cell[] rowData = null;

  public ReadRecord(Sheet sheet) {
    this.mySheet = sheet;
  }

  public void setSheet(Sheet sheet){
    this.mySheet = sheet;
  }
  public void setRow(int row){
    this.row = row + this.baseRow;
//    if (this.mySheet == null) {
//      System.out.println("this.mySheet == null");
//    }
//    if (this.mySheet.getRow(this.row) == null) {
//      System.out.println("this.mySheet.getRow(this.row) == null");
//    }
//    if (this.rowData == null) {
//          System.out.println("this.rowData == null");
//    }
    rowData = this.mySheet.getRow(this.row);
  }

  public void moveNext(){
    this.row ++;
    try {

      rowData = this.mySheet.getRow(row);
    }
    catch (Exception ex) {
      rowData =  null;
    }
  }

  public void movePrevious(){
    this.row --;
    rowData = this.mySheet.getRow(row);
  }

  /**
   * 判断当前行是否为空数据行
   * Judge if present row data is empty contents.
   * 如果是空数据行,返回true;
   */
  public boolean isEmptyrow(){
    boolean empty = true;
    if (rowData != null) {

      for (int i = 0; i < rowData.length; i++) {
        if (!(rowData[i].getContents().equals(""))) {
          empty = false;
          break;
        }
      }
    }else{
      return true;
    }
    return empty;
  }


}

⌨️ 快捷键说明

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