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

📄 server.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
字号:
// **********************************************************************// // <copyright>// //  BBN Technologies//  10 Moulton Street//  Cambridge, MA 02138//  (617) 873-8000// //  Copyright (C) BBNT Solutions LLC. All rights reserved.// // </copyright>// **********************************************************************// $Source: /cvs/distapps/openmap/src/openmap/com/bbn/openmap/layer/vpf/Server.java,v $// $Revision: 1.3.2.1 $ $Date: 2004/10/14 18:27:21 $ $Author: dietrick $// **********************************************************************package com.bbn.openmap.layer.vpf;import java.util.*;import com.bbn.openmap.util.Debug;/** * Poorly named, this class just parses VPF format files and dumps * them to System.out(). If you want output to come from the * applicable objects that parse the format files, and you only want * that output to come when this Server is run, use the Debug flag * "vpfserver" in those object classes. */public class Server {    /**     * Just a test main to parse vpf datafiles     *      * @param args files to parse, plus other command line flags     */    public static void main(String[] args) {        Debug.init(System.getProperties());        boolean schemaonly = false;        boolean printall = false;        boolean parseall = false;        System.out.println("This class just decodes and print VPF files.");        System.out.println("use the DcwSpecialist class to run the specialist");        Debug.put("vpfserver");        if (Debug.debugging("vpf")) {            Debug.output("This file doesn't have debugging info.");        }        for (int i = 0; i < args.length; i++) {            System.out.println(args[i]);            if (args[i].equals("-schemaOnly")) {                schemaonly = !schemaonly;            } else if (args[i].equals("-printAll")) {                printall = !printall;            } else if (args[i].equals("-parseAll")) {                parseall = !parseall;            } else if (args[i].equals("-help")) {                System.out.println(" -schemaOnly -printAll -parseAll -help [files]");            }            if (args[i].startsWith("-")) {                continue;            }            try {                String f = args[i];                if (args[i].endsWith("x") || args[i].endsWith("x.")) {                    System.out.println("Skipping VLI format");                } else if (args[i].endsWith("ti")) {                    System.out.println("Trying Thematic Index format");                    DcwThematicIndex ff = new DcwThematicIndex(f, false);                    ff.close();                } else if (args[i].endsWith("si") || args[i].endsWith("si.")) {                    System.out.println("Trying Spatial Index format");                    DcwSpatialIndex ff = new DcwSpatialIndex(f, false);                    ff.close();                } else if (args[i].endsWith(".doc")) {                    DcwRecordFile foo = new DcwRecordFile(f);                    String colname[] = { "text" };                    char tschema[] = { 'T' };                    int lschema[] = { -1 };                    int cols[];                    try {                        cols = foo.lookupSchema(colname,                                true,                                tschema,                                lschema,                                false);                    } catch (com.bbn.openmap.io.FormatException e) {                        foo.printSchema();                        throw e;                    }                    for (List l = new ArrayList(); foo.parseRow(l);) {                        System.out.println(l.get(cols[0]));                    }                    System.out.println();                    foo.close();                } else {                    DcwRecordFile foo = new DcwRecordFile(f);                    foo.printSchema();                    if (!schemaonly) {                        if (printall) {                            for (List l = new ArrayList(); foo.parseRow(l);) {                                System.out.println(VPFUtil.listToString(l));                            }                        } else if (parseall) {                            foo.parseAllRowsAndPrintSome();                        } else {                            foo.parseSomeRowsAndPrint();                        }                    }                    foo.close();                }            } catch (com.bbn.openmap.io.FormatException f) {                System.err.println("****************************************");                System.err.println("*--------------------------------------*");                System.err.println("Format error in dealing with " + args[i]);                System.err.println(f.getMessage());                System.err.println("*--------------------------------------*");                System.err.println("****************************************");            }        }    }}

⌨️ 快捷键说明

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