less2pointtrack.java

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

JAVA
60
字号
package net.aetherial.gis.our.auto.check.Integritytrk;

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

/**
 * <p>Title: </p>
 *
 * <p>Description: 航迹点的数量小于2</p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author 王爱国
 * @version 1.0
 */
public class Less2PointTrack {
  Node[] alltrk = null;
  private String n = "";
  private int dataCount = 0;

  public Less2PointTrack() {
  }
  public void checkAll(){
    alltrk = ItemValue.getTracks();
    if (alltrk != null) {
      for (int i = 0; i < alltrk.length; i++) {
          if (this.isLessThan2(alltrk[i])) {
            n = n + "<" + ItemValue.getTracksName(alltrk[i]) + ">["+(i+1)+"]";
                dataCount++;
          }
      }
      if (!(n.equals(""))) {
        this.n = "\"\",\"\",\"\",\"\",文件<" + ItemValue.fileName + ">里有" + this.dataCount + "个航迹点数量小于2的航迹.\r\n 航迹名称为:" + n +"\r\n";
      }
    }
  }
  private boolean isLessThan2(Node trk){
    NodeList nl = ItemValue.getTracksPoint(trk);
    if (nl == null) {
      return true;
    }
    else if (nl.getLength() <2) {
      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 + -
显示快捷键?