📄 readxiandao.java
字号:
package net.aetherial.gis.our.duibi.readXLS;
import net.aetherial.gis.our.duibi.data.RoadGLJ;
import jxl.NumberCell;
import net.aetherial.gis.our.duibi.data.AllRoad;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class ReadXiandao extends ReadFile{
private String number = "";
public ReadXiandao() {
this.setSheet("file\\glj\\xiandao.xls","T062");
this.row = this.baseRow;
}
private RoadGLJ getGljRoad(){
RoadGLJ glj = new RoadGLJ();
glj.setRoadNumber(number);
glj.setShixian(rowData[2].getContents().replaceAll(" ",""));
try {
glj.setLicheng(Double.parseDouble(rowData[5].getContents().trim()));
}
catch (NumberFormatException ex) {
glj.setLicheng(0);
// System.out.println("Error:" +rowData[2].getContents()+"\t" + number);
}
return glj;
}
/**
* 是否是统计\小结
*/
private boolean isTongji(){
if ((rowData[1].getContents().trim()).equals("")) {
return false;
}else{
this.number = rowData[1].getContents().trim();
return true;
}
}
public void addXianDao(){
while (true) {
this.moveNext();
if (!this.isEmptyrow()) {
if (!this.isTongji()) {
AllRoad.add(this.getGljRoad());
}
}else{
break;
}
}
}
public static void main(String args[]){
ReadXiandao rx = new ReadXiandao();
while (true) {
rx.moveNext();
if (!rx.isEmptyrow()) {
if (!rx.isTongji()) {
AllRoad.add(rx.getGljRoad());
// System.out.println(rx.getGljRoad());
}else{
// System.out.println("***********");
}
}else{
break;
}
}
RoadGLJ[] temp = AllRoad.getGljData("芜湖","繁昌");
if (temp != null) {
for (int i = 0; i < temp.length; i++) {
System.out.println(temp[i]);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -