nodata.java

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

JAVA
70
字号
package net.aetherial.gis.our.auto.check.Integritywpt;

import org.w3c.dom.Node;
import net.aetherial.gis.surface.ItemValue;

/**
 * <p>Title: </p>
 *
 * <p>Description: 判断是否是属于没有数据的那种航点</p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author 王爱国
 * @version 1.0
 */
public class NoData {
  Node[] allwpt = null;
  private String n = "";
  private int dataCount = 0;

  public NoData() {
  }
  public void checkAll(){
    allwpt = ItemValue.getWaypoint();
    if (allwpt != null) {
      for (int i = 0; i < allwpt.length; i++) {
          if (this.isNoData(allwpt[i])) {
            n = n + "<" + ItemValue.getWaypointName(allwpt[i]) + ">["+(i+1)+"]";
                dataCount++;
          }
      }
      if (!(n.equals(""))) {
        this.n = "\"\",\"\",\"\",\"\",文件<" + ItemValue.fileName + ">里有" + this.dataCount + "个包含不完整信息的航点.航点名称为:" + n +"\r\n";
      }
    }
  }

  private boolean isNoData(Node wpt) {
    String name = (ItemValue.getWaypointName(wpt)).trim();
    String x = ItemValue.getWaypointX(wpt);
    String y = ItemValue.getWaypointY(wpt);
    String z = ItemValue.getWaypointZ(wpt);
    if (name.equals("")) {
      return true;
    }
    else if (x.equals("")) {
      return true;
    }
    else if (y.equals("")) {
      return true;
    }
    else if (z.equals("")) {
      return true;
    }
    else {
      return false;
    }
  }
  public String getN(){
    return this.n ;
  }
  public void reset(){
    this.n ="";
    this.dataCount = 0;
  }

}

⌨️ 快捷键说明

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