📄 allroad.java
字号:
package net.aetherial.gis.our.duibi.data;
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 AllRoad {
private static RoadGLJ[] roadGlj = null;
public AllRoad() {
}
public static void add(RoadGLJ glj) {
if (roadGlj == null) {
roadGlj = new RoadGLJ[1];
roadGlj[0] = glj;
}
else {
RoadGLJ[] temp = new RoadGLJ[roadGlj.length + 1];
for (int i = 0; i < roadGlj.length; i++) {
temp[i] = roadGlj[i];
}
temp[temp.length - 1] = glj;
roadGlj = temp;
}
}
public static void removeAll(){
roadGlj = null;
}
/**
* 去除掉被匹配的
*/
public static void removeFinded(){
if (AllRoad.roadGlj != null) {
Vector ve = new Vector();
for (int i = 0; i < AllRoad.roadGlj.length; i++) {
if (!AllRoad.roadGlj[i].find) {
ve.addElement(AllRoad.roadGlj[i]);
}
}
RoadGLJ[] temp = new RoadGLJ[ve.size()];
for (int i = 0; i < temp.length; i++) {
temp[i] = (RoadGLJ)ve.elementAt(i);
}
AllRoad.roadGlj = temp;
}
}
public static void setToShiXian(String shi, String xian){
roadGlj = getGljData(shi,xian);
}
public static double getGljRightLicheng(String shi, String xian,String luxian){
RoadGLJ[] temp = getGljData(shi,xian);
if (temp != null) {
for (int i = 0; i < temp.length; i++) {
if (temp[i].getRoadNumber().indexOf(luxian) != -1) {
return temp[i].getLicheng();
}
}
}
return -1;
}
/**
* 如果想要取得市下的路,将@param xian 置空
* 市、县名称必须大于或者等于简约名称
*/
public static RoadGLJ[] getGljData(String shi, String xian) {
Vector ve = new Vector();
if (shi.equals("")) {
return null;
}
if (AllRoad.roadGlj == null) {
return null;
}
for (int i = 0; i < AllRoad.roadGlj.length; i++) {
if (shi.indexOf(AllRoad.roadGlj[i].getShi()) != -1) {
ve.addElement(AllRoad.roadGlj[i]);
}
}
RoadGLJ[] temp = new RoadGLJ[ve.size()];
for (int i = 0; i < temp.length; i++) {
temp[i] = (RoadGLJ)ve.elementAt(i);
}
if (xian.trim().equals("")) {
return temp;
}else{
if (temp == null) {
return null;
}
ve.removeAllElements();
if (xian.equals("*")) {
for (int i = 0; i < temp.length; i++) {
if (temp[i].getXian().indexOf("区") != -1) {
ve.addElement(temp[i]);
}
}
}else{
for (int i = 0; i < temp.length; i++) {
if (xian.indexOf(temp[i].getXian().substring(0,2)) != -1) {
ve.addElement(temp[i]);
}
}
}
temp = new RoadGLJ[ve.size()];
for (int i = 0; i < temp.length; i++) {
temp[i] = (RoadGLJ) ve.elementAt(i);
}
return temp;
}
}
public static RoadGLJ[] getGljData() {
return AllRoad.roadGlj;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -