index.java
来自「Online Map for Mobile」· Java 代码 · 共 44 行
JAVA
44 行
public class Index extends Location {
static final int SUBINDEX = 0;
static final int POINT = 1;
static final int LINE = 3;
static final int RECTANGLE = 2;
int type;
Location[] objects;
Index() {}
Index(XMLElement elem) {
super(elem.getAttribute("name").getValue());
String t = elem.getAttribute("type").getValue();
if (t.equals("subindex")) {
type = SUBINDEX;
} else if (t.equals("point")) {
type = POINT;
} else if (t.equals("line")) {
type = LINE;
} else if (t.equals("rectangle")) {
type = RECTANGLE;
}
XMLElement location = elem.getSibling("location");
if (location == null) {
location = elem.getSibling("index");
if (location == null) {
objects = new Location[0];
} else {
objects = new Location[location.getCounter()];
for (int i = 0; i < objects.length; i++) {
objects[i] = new Index(location);
location = location.getNextSibling();
}
}
} else {
objects = new Location[location.getCounter()];
for (int i = 0; i < objects.length; i++) {
objects[i] = new Location(location);
location = location.getNextSibling();
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?