📄 runall.java
字号:
package net.aetherial.gis.test.tools.bian2;
import net.aetherial.gis.test.tools.bian1.FindArrayToExcel;
import net.aetherial.gis.test.tools.bian1.ShiXianXiangCun;
import java.io.File;
import net.aetherial.gis.surface.CreateFile;
import net.aetherial.gis.dataType.TrackType;
import java.util.Vector;
import java.text.DecimalFormat;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class RunAll {
FindArrayToExcel fe = new FindArrayToExcel();
private Vector bianmaSet = new Vector();
public RunAll() {
}
public void read() {
ReadTongda readTongda = new ReadTongda(
"C:\\Documents and Settings\\Administrator\\桌面\\编码\\22.xls");
readTongda.read();
System.out.println("22.xls read ok!");
ReadLuxian readluxian = new ReadLuxian(
"C:\\Documents and Settings\\Administrator\\桌面\\编码\\55.xls");
readluxian.read();
System.out.println("44.xls read ok!");
fe.readExcel();
System.out.println("FindArrayToExcel.xls read ok!");
}
private boolean isInBianmaSet(String bianma) {
for (int i = 0; i < this.bianmaSet.size(); i++) {
if (this.bianmaSet.get(i).equals(bianma)) {
return true;
}
}
return false;
}
public void compare() {
String n = "";
String notFind = "";
ShiXianXiangCun[] cuns = fe.getShiXianXiangCun();
LuxianRow[] luxians = null;
TongdaRow tongda = null;
System.out.println("cuns.length:" + cuns.length);
System.out.println("Permanence.tongda.size():" + Permanence.tongda.size());
for (int i = 0; i < cuns.length; i++) {
for (int j = 0; j < Permanence.tongda.size(); j++) {
tongda = (TongdaRow) Permanence.tongda.get(j);
if (tongda.getBianma().trim().equals(cuns[i].getCunBianma().trim())) {
System.out.println(" Find: " + tongda.getBianma() + "," +
tongda.getName() + "," + tongda.getRaodBianma());
// n += cuns[i].getCunBianma() + "\r\t";
// n += cuns[i].getCunName() + "\r\t";
luxians = Permanence.getluxian(tongda);
if (luxians.length == 0) {
System.out.println(" ** Find not luxians.");
notFind += tongda.getBianma() + "\t" + tongda.getName() +
tongda.getRaodBianma() + "\r\n";
}
else {
System.out.println(" !! Find luxians.");
}
for (int k = 0; k < luxians.length; k++) {
if ( (Double.parseDouble(luxians[k].getLumian().trim()) < 3.5 ||
(
luxians[k].getType().trim().equals(TrackType.
RS_JTB_8_WuLumian)))
// && !this.isInBianmaSet(luxians[k].getBianma())
) {
n += cuns[i].getShiBianma() + "\t";
n += cuns[i].getShiName() + "\t";
n += cuns[i].getXianBianma() + "\t";
n += cuns[i].getXianName() + "\t";
n += cuns[i].getXiangBianma() + "\t";
n += cuns[i].getXiangName() + "\t";
n += cuns[i].getCunBianma() + "\t";
n += cuns[i].getCunName() + "\t";
n += luxians[k].getBianma() + "\t";
n += luxians[k].getId() + "\t";
n += luxians[k].getLuji() + "\t";
n += luxians[k].getLumian() + "\t";
n += luxians[k].getType() + "\t";
n += luxians[k].getLicheng() + "\t";
n += "\r\n";
bianmaSet.add(luxians[k].getBianma());
}
// n += cuns[i].getShiBianma() + "\t";
// n += cuns[i].getShiName() + "\t";
// n += cuns[i].getXianBianma() + "\t";
// n += cuns[i].getXianName() + "\t";
// n += cuns[i].getXiangBianma() + "\t";
// n += cuns[i].getXiangName() + "\t";
// n += cuns[i].getCunBianma() + "\t";
// n += cuns[i].getCunName() + "\t";
// n += luxians[k].getBianma() + "\t";
// n += luxians[k].getId() + "\t";
// n += luxians[k].getLuji() + "\t";
// n += luxians[k].getLumian() + "\t";
// n += luxians[k].getType() + "\t";
// n += luxians[k].getLicheng() + "\t";
// n += "\r\n";
}
}
}
}
System.out.println("notFind:" + notFind);
this.createLogFile(n);
}
public void compare_未通达() {
java.text.DecimalFormat format = new DecimalFormat("#.#");
String n = "";
String notFind = "";
String temp = "";
boolean find = false;
double minLumina = Double.MAX_VALUE, maxLumina = Double.MIN_VALUE,
lumiankudandu, maxLuji = Double.MIN_VALUE, minLuji = Double.MAX_VALUE,
lujiKuandu;
ShiXianXiangCun[] cuns = fe.getShiXianXiangCun();
LuxianRow[] luxians = null;
TongdaRow tongda = null;
System.out.println("cuns.length:" + cuns.length);
System.out.println("Permanence.tongda.size():" + Permanence.tongda.size());
for (int i = 0; i < cuns.length; i++) {
for (int j = 0; j < Permanence.tongda.size(); j++) {
tongda = (TongdaRow) Permanence.tongda.get(j);
if (tongda.getBianma().trim().equals(cuns[i].getCunBianma().trim())) {
System.out.println(" Find: " + tongda.getBianma() + "," +
tongda.getName() + "," + tongda.getRaodBianma());
// n += cuns[i].getCunBianma() + "\r\t";
// n += cuns[i].getCunName() + "\r\t";
luxians = Permanence.getluxian(tongda);
if (luxians.length == 0) {
System.out.println(" ** Find not luxians.");
notFind += tongda.getBianma() + "\t" + tongda.getName() +
tongda.getRaodBianma() + "\r\n";
}
else {
System.out.println(" !! Find luxians.");
}
minLumina = Double.MAX_VALUE;
maxLumina = Double.MIN_VALUE;
maxLuji = Double.MIN_VALUE;
minLuji = Double.MAX_VALUE;
find = false;
for (int k = 0; k < luxians.length; k++) {
if ( (Double.parseDouble(luxians[k].getLumian().trim()) < 3.5 ||
(
luxians[k].getType().trim().equals(TrackType.
RS_JTB_8_WuLumian)))
// && !this.isInBianmaSet(luxians[k].getBianma())
) {
// n += cuns[i].getShiBianma() + "\t";
// n += cuns[i].getShiName() + "\t";
// n += cuns[i].getXianBianma() + "\t";
// n += cuns[i].getXianName() + "\t";
// n += cuns[i].getXiangBianma() + "\t";
// n += cuns[i].getXiangName() + "\t";
// n += cuns[i].getCunBianma() + "\t";
// n += cuns[i].getCunName() + "\t";
// n += luxians[k].getBianma() + "\t";
// n += luxians[k].getId() + "\t";
// n += luxians[k].getLuji() + "\t";
// n += luxians[k].getLumian() + "\t";
// n += luxians[k].getType() + "\t";
// n += luxians[k].getLicheng() + "\t";
// n += "\r\n";
// bianmaSet.add(luxians[k].getBianma());
lumiankudandu = Double.parseDouble(luxians[k].getLumian().trim());
lujiKuandu = Double.parseDouble(luxians[k].getLuji().trim());
if (minLumina >= lumiankudandu) {
minLumina = lumiankudandu;
}
if (maxLumina <= lumiankudandu) {
maxLumina = lumiankudandu;
}
if (maxLuji <= lujiKuandu) {
maxLuji = lujiKuandu;
}
if (minLuji >= lujiKuandu) {
minLuji = lujiKuandu;
}
find = true;
}
}
if (find) {
n += cuns[i].getCunBianma() + "\t";
n += cuns[i].getCunName() + "\t";
n += tongda.getRaodBianma() + "\t";
n += format.format(maxLuji) + "\t";
n += format.format(minLuji) + "\t";
n += format.format(maxLumina) + "\t";
n += format.format(minLumina) + "\t";
n += "" + "\t";
n += "\r\n";
}
}
}
}
System.out.println("notFind:" + notFind);
this.createLogFile(n);
}
public static String createLogFile(String content) {
File f = new File("C:\\Documents and Settings\\Administrator\\桌面\\编码\\编码" +
System.currentTimeMillis() + ".txt");
CreateFile cf = new CreateFile(f);
cf.memoryToFile(content);
return f.getAbsolutePath();
}
public static void main(String args[]) {
RunAll ra = new RunAll();
ra.read();
ra.compare_未通达();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -