⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.java

📁 Online Map for Mobile
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -