亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? miffile.java

?? .mif .mid file read and write
?? JAVA
?? 第 1 頁 / 共 5 頁
字號(hào):
                        PrecisionModel.FLOATING), SRID.intValue());
        }

        geometryName = (String) getParam(MIFDataStore.PARAM_GEOMNAME,
                "the_geom", false, params);
        fieldNameCase = ((String) getParam(MIFDataStore.PARAM_FIELDCASE, "",
                false, params)).toLowerCase();

        geometryClass = ((String) getParam(MIFDataStore.PARAM_GEOMTYPE,
                "untyped", false, params)).toLowerCase();

        namespace = (URI) getParam("namespace", FeatureTypes.DEFAULT_NAMESPACE, false,
                params);
    }

    /**
     * Returns a parameter value from the parameters map
     *
     * @param name
     * @param defa
     * @param required
     * @param params
     *
     *
     * @throws IOException if required parameter is missing
     */
    private Object getParam(String name, Object defa, boolean required,
        Map params) throws IOException {
        Object result;

        try {
            result = params.get(name);
        } catch (Exception e) {
            result = null;
        }

        if (result == null) {
            if (required) {
                throw new IOException("MIFFile: parameter " + name
                    + " is required");
            }

            result = defa;
        }

        return result;
    }

    /**
     * <p>
     * Sets the value for a Header Clause. Possible values are:
     * </p>
     * 
     * <ul>
     * <li>
     * MIFDataStore.HCLAUSE_VERSION = Version number ("310")
     * </li>
     * <li>
     * MIFDataStore.HCLAUSE_CHARSET = Charset name ("WindowsLatin1")
     * </li>
     * <li>
     * MIFDataStore.HCLAUSE_UNIQUE = Comma-separated list of field indexes
     * (1..numFields) corresponding to unique values (i.e. street names for
     * street segments)
     * </li>
     * <li>
     * MIFDataStore.HCLAUSE_INDEX = Comma-separated list of field indexes
     * (1..numFields) indicating which fields have to be indexed in MapInfo
     * </li>
     * <li>
     * MIFDataStore.HCLAUSE_COORDSYS = MapInfo CoordSys clause
     * </li>
     * <li>
     * MIFDataStore.HCLAUSE_TRANSFORM = Comma-separated list of four
     * transformation parameters ("1000, 1000, 0, 0")
     * </li>
     * </ul>
     * 
     *
     * @param clause Name of the Header Clause
     * @param value Value for the Header Clause
     *
     * @throws IOException Bad delimiter was specified
     */
    private void setHeaderClause(String clause, String value)
        throws IOException {
        if (value == null) {
            value = "";
        }

        if (clause.equals(MIFDataStore.HCLAUSE_DELIMITER)
                && (value.equals("") || value.equals("\""))) {
            throw new IOException("Bad delimiter specified");
        }

        header.put(clause, value);
    }

    /**
     * Gets the value for an header clause
     *
     * @param clause
     *
     */
    public String getHeaderClause(String clause) {
        try {
            return (String) getParam(clause, "", false, header);
        } catch (Exception e) {
            return "";
        }
    }

    /**
     * <p>
     * Opens the MIF file for input and returns a  FeatureReader<SimpleFeatureType, SimpleFeature> for accessing
     * the features.
     * </p>
     * 
     * <p>
     * TODO Concurrent file access is still not handled. MUST LOCK FILE and
     * return an error if another  FeatureReader<SimpleFeatureType, SimpleFeature> is open - Handle concurrent
     * access with synchronized(mif) / or Filesystem locking is enough?
     * </p>
     *
     * @return A  FeatureReader<SimpleFeatureType, SimpleFeature> for reading features from MIF/MID file
     *
     * @throws IOException
     */
    public  FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader() throws IOException {
        MIFFileTokenizer mifTokenizer = null;
        MIFFileTokenizer midTokenizer = null;

        // if exists outMIF throw new IOException("File is being accessed in write mode");
        try {
            mifTokenizer = new MIFFileTokenizer(new BufferedReader(
                        new FileReader(mifFile)));
            midTokenizer = new MIFFileTokenizer(new BufferedReader(
                        new FileReader(midFile)));
            readMifHeader(true, mifTokenizer); // skips header

            return new Reader(mifTokenizer, midTokenizer);
        } catch (Exception e) {
            if (mifTokenizer != null) {
                mifTokenizer.close();
            }

            if (midTokenizer != null) {
                midTokenizer.close();
            }

            throw new IOException("Error initializing reader: " + e.toString());
        }
    }

    /**
     * Returns a FeatureWriter for writing features to the MIF/MID file.
     *
     * @return A featureWriter for this file
     *
     * @throws IOException
     */
    public FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter() throws IOException {
        return getFeatureWriter(false);
    }

    /**
     * <p>
     * Private FeatureWriter in append mode, could be called by
     * DataStore.getFeatureWriterAppend(); not implemented yet
     * </p>
     *
     * @param append
     *
     *
     * @throws IOException
     */
    private FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(boolean append)
        throws IOException {
        if (append) {
            // copy inMif to OutMIf
        } else {
            // WriteHeader
        }

        PrintStream outMif = new PrintStream(new FileOutputStream(mifFileOut,
                    append));
        PrintStream outMid = new PrintStream(new FileOutputStream(midFileOut,
                    append));

        return new Writer(outMif, outMid, append);
    }

    /**
     * Creates the MIF file header
     *
     * @return the Header as a String
     *
     * @throws SchemaException A required header clause is missing.
     */
    private String exportHeader() throws SchemaException {
        // Header tags passed in parameters are overridden by the tags read from mif file 
        String header = exportClause(MIFDataStore.HCLAUSE_VERSION, true, false)
            + exportClause(MIFDataStore.HCLAUSE_CHARSET, true, true) // TODO Charset clause support should imply character conversion????
            + exportClause(MIFDataStore.HCLAUSE_DELIMITER, true, true)
            + exportClause(MIFDataStore.HCLAUSE_UNIQUE, false, false)
            + exportClause(MIFDataStore.HCLAUSE_INDEX, false, false)
            + exportClause(MIFDataStore.HCLAUSE_COORDSYS, false, false)
            + exportClause(MIFDataStore.HCLAUSE_TRANSFORM, false, false);

        header += ("Columns " + (numAttribs - 1) + "\n");

        for (int i = 1; i < numAttribs; i++) {
            AttributeDescriptor at = featureType.getAttribute(i);
            header += ("  " + at.getLocalName() + " " + getMapInfoAttrType(at)
            + "\n");
        }

        header += "Data\n";

        return header;
    }

    private String exportClause(String clause, boolean required, boolean quote)
        throws SchemaException {
        String result = getHeaderClause(clause);

        if (!result.equals("")) {
            if (quote) {
                result = MIFStringTokenizer.strQuote(result);
            }

            return clause + " " + result + "\n";
        }

        if (required) {
            throw new SchemaException("Header clause " + clause
                + " is required.");
        }

        return "";
    }

    /**
     * Maps an AttributeType to a MapInfo field type
     *
     * @param at Attribute Type
     *
     * @return the String description of the MapInfo Type
     */
    private String getMapInfoAttrType(AttributeDescriptor at) {
        if (at.getType().getBinding() == String.class) {
        	
            int l = AttributeTypes.getFieldLength(at, MAX_STRING_LEN);

            if (l <= 0) {
                l = MAX_STRING_LEN;
            }

            return "Char(" + l + ")";
        } else if (at.getType().getBinding() == Integer.class) {
            return "Integer";
        } else if ((at.getType().getBinding() == Double.class)
                || (at.getType().getBinding() == Float.class)) {
            return "Float";
        } else if (at.getType().getBinding() == Boolean.class) {
            return "Logical";
        } else if (at.getType().getBinding() == Date.class) {
            return "Date";
        } else {
            return "Char(" + MAX_STRING_LEN + ")"; // TODO Should it raise an exception here (UnsupportedSchema) ?
        }
    }

    /**
     * Sets the path name of the MIF and MID files
     *
     * @param path The full path of the .mif file, with or without extension
     * @param mustExist True if opening file for reading
     *
     * @throws FileNotFoundException
     */
    private void initFiles(String path, boolean mustExist)
        throws FileNotFoundException {
        File file = new File(path);

        if (file.isDirectory()) {
            throw new FileNotFoundException(path + " is a directory");
        }

        String fName = getMifName(file.getName());
        file = file.getParentFile();

        mifFile = getFileHandler(file, fName, ".mif", mustExist);
        midFile = getFileHandler(file, fName, ".mid", mustExist);

        mifFileOut = getFileHandler(file, fName, ".mif.out", false);
        midFileOut = getFileHandler(file, fName, ".mid.out", false);
    }

    /**
     * Returns the name of a .mif file without extension
     *
     * @param fName The file name, possibly with .mif extension
     *
     * @return The name with no extension
     *
     * @throws FileNotFoundException if extension was other than "mif"
     */
    protected static String getMifName(String fName)
        throws FileNotFoundException {
        int ext = fName.lastIndexOf(".");

        if (ext > 0) {
            String theExt = fName.substring(ext + 1).toLowerCase();

            if (!(theExt.equals("mif"))) {
                throw new FileNotFoundException(
                    "Please specify a .mif file extension.");
            }

            fName = fName.substring(0, ext);
        }

        return fName;
    }

    /**
     * Utility function for initFiles - returns a File given a parent path, the
     * file name without extension and the extension Tests different extension
     * case for case-sensitive filesystems
     *
     * @param path Directory containing the file
     * @param fileName Name of the file with no extension
     * @param ext extension with trailing "."
     * @param mustExist If true, raises an excaption if the file does not exist
     *
     * @return The File object
     *
     * @throws FileNotFoundException
     */
    protected static File getFileHandler(File path, String fileName,
        String ext, boolean mustExist) throws FileNotFoundException {
        File file = new File(path, fileName + ext);

        if (file.exists() || !mustExist) {
            return file;
        }

        file = new File(path, fileName + ext.toUpperCase());

        if (file.exists()) {
            return file;
        }

        throw new FileNotFoundException("Can't find file: " + file.getName());
    }

    /**

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区在线观看动漫| 91在线视频免费91| 欧美日韩久久一区二区| 亚洲黄色录像片| 91免费看`日韩一区二区| 国产精品免费视频一区| 国产不卡在线视频| 亚洲欧洲国产专区| 91毛片在线观看| 亚洲电影你懂得| 欧洲人成人精品| 视频一区在线视频| 日韩精品中文字幕在线一区| 精品在线亚洲视频| 久久久青草青青国产亚洲免观| 国产精品白丝jk黑袜喷水| 欧美韩日一区二区三区| 91亚洲国产成人精品一区二三| 亚洲精品免费在线| 337p亚洲精品色噜噜狠狠| 国产一区二区免费看| 中文字幕亚洲区| 91精品国产综合久久小美女| 免费观看一级欧美片| 中文字幕在线一区二区三区| 日本高清视频一区二区| 日韩和欧美一区二区| 国产欧美在线观看一区| 精品视频在线视频| 粉嫩嫩av羞羞动漫久久久| 亚洲电影第三页| 中文字幕欧美日韩一区| 欧美一区二区免费视频| 成人激情小说网站| 日韩av在线发布| 国产精品久久久久久久久久免费看| 欧美日韩国产电影| 白白色 亚洲乱淫| 老司机免费视频一区二区| 亚洲欧美日韩国产综合| 精品欧美久久久| 欧美日韩色综合| 99精品在线免费| gogogo免费视频观看亚洲一| 亚洲图片欧美综合| 亚洲精品视频在线看| 久久蜜桃香蕉精品一区二区三区| 欧美日韩欧美一区二区| av在线不卡网| 大白屁股一区二区视频| 国产精品一区二区在线观看网站 | 日韩欧美国产精品| 色哟哟精品一区| 色婷婷综合久久久中文字幕| 成人午夜电影久久影院| 成人一区二区三区在线观看| 麻豆精品一区二区综合av| 全国精品久久少妇| 美腿丝袜亚洲色图| 国产不卡高清在线观看视频| 国产精品一卡二| 成人h动漫精品一区二区| 一本在线高清不卡dvd| 在线观看91视频| 日韩一区二区三区三四区视频在线观看| 欧美在线观看视频一区二区三区 | 韩国精品主播一区二区在线观看| 久久疯狂做爰流白浆xx| 岛国精品在线播放| 在线一区二区三区| 欧美一区中文字幕| 国产精品伦理在线| 亚洲国产精品一区二区久久 | 成人在线视频一区二区| 91年精品国产| 久久这里都是精品| 亚洲日本青草视频在线怡红院| 亚洲国产中文字幕在线视频综合| 久久se精品一区二区| 成人激情动漫在线观看| 日韩视频免费观看高清在线视频| 国产日韩欧美综合在线| 午夜精品久久久久影视| 成人午夜av电影| 日韩一级成人av| 亚洲午夜精品在线| 成人中文字幕合集| 精品国产乱码91久久久久久网站| 中文字幕人成不卡一区| 狠狠色丁香九九婷婷综合五月| 一本一道久久a久久精品| 欧美国产视频在线| 精品一区二区av| 欧美一卡二卡在线| 亚洲大片精品永久免费| av不卡在线观看| 国产区在线观看成人精品| 久久精品国产99| 2021国产精品久久精品| 调教+趴+乳夹+国产+精品| 在线观看精品一区| 亚洲一区在线观看视频| 欧美综合一区二区| 一个色在线综合| 在线免费观看视频一区| 夜夜嗨av一区二区三区网页| 欧美性生活一区| 日韩精品一级中文字幕精品视频免费观看| 99久久er热在这里只有精品15 | 一区二区三区丝袜| 欧美日韩一级视频| 久久99久久久欧美国产| 久久久久久久久一| 99精品国产99久久久久久白柏| 亚洲免费电影在线| 精品免费99久久| 成人激情av网| 蜜桃久久精品一区二区| 亚洲国产岛国毛片在线| 欧美三级日韩三级国产三级| 麻豆一区二区在线| 依依成人精品视频| 欧美mv日韩mv| 91精品办公室少妇高潮对白| 日本不卡的三区四区五区| 国产午夜精品理论片a级大结局 | www.欧美.com| 日韩不卡免费视频| **性色生活片久久毛片| 欧美成人一区二区三区在线观看| 国产·精品毛片| 老司机午夜精品99久久| 一区二区三区在线视频观看| 久久精品视频在线看| 欧美挠脚心视频网站| 91丨九色丨国产丨porny| 九九精品一区二区| 偷拍一区二区三区| 自拍偷拍国产亚洲| 久久久久久久久久久久久女国产乱| 欧美亚洲高清一区二区三区不卡| 激情都市一区二区| 老司机精品视频在线| 天堂一区二区在线| 亚洲444eee在线观看| 亚洲午夜电影在线观看| 亚洲天堂2014| 中文字幕视频一区| 国产欧美一区二区精品久导航 | 成人教育av在线| 成人av资源下载| 成人av小说网| 欧美三区在线观看| 欧美性极品少妇| 欧美一级专区免费大片| 欧美一级二级三级乱码| 91精品国产黑色紧身裤美女| 欧美人与性动xxxx| 欧美xxx久久| 国产欧美精品在线观看| 中国av一区二区三区| 成人欧美一区二区三区| 亚洲男人的天堂一区二区 | 亚洲欧洲精品成人久久奇米网| 最近日韩中文字幕| 亚洲va欧美va国产va天堂影院| 日本不卡不码高清免费观看| 国产精品夜夜嗨| 在线观看av一区二区| 日韩三级伦理片妻子的秘密按摩| 26uuu精品一区二区在线观看| 国产蜜臀av在线一区二区三区| 一区二区三区日韩欧美精品| 美女在线一区二区| jvid福利写真一区二区三区| 欧美伦理视频网站| 国产精品美女一区二区| 天天色综合天天| 91热门视频在线观看| 亚洲精品在线观| 日韩电影在线一区二区三区| 成人黄页在线观看| 日韩精品一区在线| 亚洲成人资源在线| 国产成人精品影视| 久久综合九色综合97婷婷女人| 亚洲蜜臀av乱码久久精品| 国产尤物一区二区在线| 欧美妇女性影城| 亚洲午夜私人影院| 色综合久久综合中文综合网| 国产校园另类小说区| 国产一区二区导航在线播放| 日韩三级高清在线| 麻豆传媒一区二区三区| 欧美一级生活片| 美女看a上一区| 久久综合久久综合久久综合| 奇米777欧美一区二区| 欧美大胆一级视频|