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

📄 featureclassinfo.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     */    public int getFaccIndex() {        return whatColumn("f_code");    }    /**     * Returns the column position of the primitive id column.     *      * @see DcwRecordFile#whatColumn(String)     */    public int getTilePrimitiveIdColIndex() {        return whatColumn(tileFileColName);    }    /**     * Return the type of feature this table is for. Returns one of     * the featuretype codes in CoverageTable.     *      * @see CoverageTable#AREA_FEATURETYPE     */    public char getFeatureType() {        return featureType;    }    /**     * Complete the initialization of the FeatureClassInfo. This     * function can be called more than once.     */    public synchronized void run() {        if (fullInit == true) {//run already ran, or the file didn't            // exist            return;        }        try {            fullInit = true;            finishInitialization(); //finish initialization of table            // The list isn't be closed as it's supposed to, and this            // is causing a leak. We'll just avoid the list for now            // and just close the files after we've read them.            //          BinaryFile.addClosable(this);        } catch (FormatException f) {            //          close(); //invalidate some stuff        }        close();    }    /**     * Implement the Closable interface     */    public boolean close(boolean done) {        close();        if (thematicIndex != null) {            try {                thematicIndex.close();            } catch (FormatException fe) {                //ignored            }        }        return true;    }    /**     * Probe the DcwRecordFile looking for what column we are in.     * (Info needed later to getDescription with the data list.)     *      * @param rf the primitive data table we'll get rows from     */    public void findYourself(DcwRecordFile rf) {        mycolumn = rf.whatColumn(columnname);    }    /**     * Given a row from the primitive table, this function returns a     * full string description of the row     *      * @param l the record list from the primitive table     * @param type the first integral type     * @return the description string for the list     */    public synchronized String getDescription(List l, MutableInt type) {        checkInit();        if (mycolumn == -1) {            return null;        }        int i = VPFUtil.objectToInt(l.get(mycolumn));        if (i <= 0) {            return null;        }        return getDescription(i, type);    }    /**     * Given a row from the primitive table, this function returns a     * full string description of the row     *      * @param ftid the record list from the primitive table     * @param colIndex column index for attribute to return     * @param type the first integral type     * @return the description string for the list     *///    public synchronized String getAttribute(List l, int colIndex,    public synchronized String getAttribute(int ftid, int colIndex,                                            MutableInt type) {        checkInit();//        if (mycolumn == -1) {//            return null;//        }//        int ftid = VPFUtil.objectToInt(l.get(mycolumn));        if (ftid <= 0) {            return null;        }        try {            if (!getRow(tmpVec, ftid)) {                return null;            }        } catch (FormatException fe) {            if (Debug.debugging("vpf")) {                fe.printStackTrace();            }        }        return getAttribute(columnInfo[colIndex], tmpVec.get(colIndex), type);    }    /**     * Check to see if the file has been fully initialized, call run()     * to do that if needed.     */    public synchronized void checkInit() {        if (fullInit == false) {            if (Debug.debugging("vpf")) {                Debug.output("FCI.checkInit() forcing init " + columnname + " "                        + tablename);            }            run();        }    }    /**     * Given an primary key (row id) for the feature table, return the     * string description. If made public, this function would need to     * be synchronized and check for proper initialization. But since     * it is always called from a method that does that, its okay.     *      * @param ftid the row id for our feature table     * @param type the first integral type     * @return the description string for the list     */    private synchronized String getDescription(int ftid, MutableInt type) {        StringBuffer retval = null;        try {            if (!getRow(tmpVec, ftid)) {                return null;            }            //boolean haveivdtindex = false;            for (int i = 0; i < columnInfo.length; i++) {                DcwColumnInfo dci = columnInfo[i];                String s = getAttribute(dci, tmpVec.get(i), type);                //////////                //                String s = null;                //                String dciVDT = dci.getVDT();                //                if (dciVDT == Constants.intVDTTableName) {                //                    int val = VPFUtil.objectToInt(tmpVec.get(i));                //                    if (val == Integer.MIN_VALUE) {//VPF null                //                        continue;                //                    }                //                    if (!haveivdtindex) {                //                        type.value = (short) val;                //                        haveivdtindex = true;                //                    }                //                    s = ctable.getDescription(tablename,                //                            dci.getColumnName(),                //                            val);                //                    if (s == null) {                //                        s = "[" + val + "]";                //                    }                //                } else if (dciVDT == Constants.charVDTTableName) {                //                    String val = (String) tmpVec.get(i);                //                    s = ctable.getDescription(tablename,                //                            dci.getColumnName(),                //                            val);                //                    if (s == null) {                //                        s = "[" + val + "]";                //                    }                //                } else if (dci.isNonKey()) {                //                    s = tmpVec.get(i).toString();                //                }                ////////                if (s != null) {                    if (retval == null) {                        retval = new StringBuffer(s);                    } else {                        retval.append("; ").append(s);                    }                }            }        } catch (FormatException e) {            if (Debug.debugging("vpf")) {                e.printStackTrace();            }        }        return ((retval == null) ? null : retval.toString());    }    protected String getAttribute(DcwColumnInfo dci, Object colObj,                                  MutableInt type) {        String s = null;        String dciVDT = dci.getVDT();        if (dciVDT == Constants.intVDTTableName) {            int val = VPFUtil.objectToInt(colObj);            if (val == Integer.MIN_VALUE) {//VPF null                return null;            }            if (type != null) {                type.value = (short) val;            }            s = ctable.getDescription(tablename, dci.getColumnName(), val);//            if (s == null) {//                s = "[" + val + "]";//            }        } else if (dciVDT == Constants.charVDTTableName) {            String val = (String) colObj;            s = ctable.getDescription(tablename, dci.getColumnName(), val);//            if (s == null) {//                s = "[" + val + "]";//            }        } else if (dci.isNonKey()) {            s = colObj.toString();        }        return s;    }}

⌨️ 快捷键说明

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