📄 parttrack.java
字号:
package net.aetherial.gis.output.toLd.repeate;
import org.w3c.dom.Node;
import java.util.Vector;
import net.aetherial.gis.surface.ItemValue;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class PartTrack {
private Node[] parts = null;
public PartTrack() {
}
public PartTrack(Node[] parts) {
this.parts = parts;
}
public void addATrk(Node trk) {
if (this.parts == null) {
this.parts = new Node[1];
this.parts[0] = trk;
}
else {
Node[] temp = this.parts;
this.parts = new Node[temp.length + 1];
for (int i = 0; i < temp.length; i++) {
this.parts[i] = temp[i];
}
this.parts[temp.length] = trk;
}
}
public void addAPart(PartTrack pt) {
if (this.parts == null) {
this.parts = pt.getParts();
}
else {
if (pt == null) {
return;
}
Vector temp = new Vector();
boolean equal = false;
Node[] temp2 = null;
temp2 = pt.getParts();
for (int i = 0; i < temp2.length; i++) {
// System.out.println("pt.getParts()57"+pt.getParts().length);
for (int j = 0; j < this.parts.length; j++) {
if (temp2[i] == this.parts[j]) {
equal = true;
}
}
if (!equal) {
temp.add(temp2[i]);
}
equal = false;
}
Node[] temp1 = this.parts;
this.parts = new Node[temp1.length + temp.size()];
for (int i = 0; i < temp1.length; i++) {
this.parts[i] = temp1[i];
}
for (int i = 0; i < temp.size(); i++) {
this.parts[i + temp1.length] = (Node) temp.get(i);
}
}
}
public Node[] getParts() {
return this.parts;
}
public String toString(){
String n = "";
if (this.parts == null) {
n = "PartTrack == null\r\n";
}else{
for (int i = 0; i < this.parts.length; i++) {
n = n + "PartTrack[" + i + "]:" + ItemValue.getTracksName(this.parts[i])+"\r\n";
}
}
return n;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -