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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? parameterreader.java

?? 非常好用的代碼源代碼統計分析工具的源代碼
?? JAVA
字號:
/* * ParameterReader.java - a class for extracting key-value pairs from * parameters. * Copyright (C) 2003-2004 Rob Spoor * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */package nl.icemanx.util;import java.util.*;/** * ParameterReader contains methods for reading and checking command line * parameters. * * @author  Rob Spoor * @version 0.4, 2003-12-01 */public final class ParameterReader{    /**     * Indicates a key without value.     */    public static final int KEY = 0;    /**     * Indicates a key with one value, separated by whitespace.     */    public static final int KEY_VALUE = 1;    /**     * Indicates a key with one value, separated by an equals sign.     */    public static final int KEY_EQUALS_VALUE = 2;    /**     * Indicates a key with multiple values.     */    public static final int KEY_VALUES = 3;    /**     * A set of keys without values.     */    private Set key;    /**     * A set of keys with one value, separated by whitespace.     */    private Set keyValue;    /**     * A set of keys without values.     */    private Set keyEqualsValue;    /**     * A set of keys with multiple values.     */    private Set keyValues;    /**     * Creates a parameter reader. Use {@link #addKeys(Set, int)} or     * {@link #addKey(String, int)} to set the keys.     */    public ParameterReader()    {        key = new HashSet();        keyValue = new HashSet();        keyEqualsValue = new HashSet();        keyValues = new HashSet();    }    /**     * Returns a set of keys.     *     * @param type The type of keys. See the static fields for possible     *        values.     * @return The set of keys of type <tt>type</tt>.     * @throws IllegalArgumentException If the type is illegal.     */    public Set getKeys(int type)    {        switch (type)        {            case KEY:                return key;            case KEY_VALUE:                return keyValue;            case KEY_EQUALS_VALUE:                return keyEqualsValue;            case KEY_VALUES:                return keyValues;            default:                throw new IllegalArgumentException("Wrong type");        }    }    /**     * Adds a set of keys.     *     * @param keys The set of keys.     * @param type The type of keys. See the static fields for possible     *        values.     * @throws IllegalArgumentException If either the type is illegal, or     *         there is a conflict in the keys.     */    public void addKeys(Set keys, int type)    {        checkKeys(keys);        getKeys(type).addAll(keys);    }    /**     * Adds a set of keys.     *     * @param keys The set of keys, in array form.     * @param type The type of keys. See the static fields for possible     *        values.     * @throws IllegalArgumentException If either the type is illegal, or     *         there is a conflict in the keys.     */    public void addKeys(String[] keys, int type)    {        addKeys(new HashSet(Arrays.asList(keys)), type);    }    /**     * Adds a key.     *     * @param key The key.     * @param type The type of keys. See the static fields for possible     *        values.     * @throws IllegalArgumentException If either the type is illegal, or     *         there is a conflict in the keys.     */    public void addKey(String key, int type)    {        addKeys(Collections.singleton(key), type);    }    /**     * Removes a set of keys.     *     * @param keys The set of keys.     * @param type The type of keys. See the static fields for possible     *        values.     * @throws IllegalArgumentException If the type is illegal.     */    public void removeKeys(Set keys, int type)    {        getKeys(type).removeAll(keys);    }    /**     * Removes a set of keys.     *     * @param keys The set of keys.     * @param type The type of keys. See the static fields for possible     *        values.     * @throws IllegalArgumentException If the type is illegal.     */    public void removeKeys(String[] keys, int type)    {        removeKeys(new HashSet(Arrays.asList(keys)), type);    }    /**     * Removes a key.     *     * @param key The key.     * @param type The type of keys. See the static fields for possible     *        values.     * @throws IllegalArgumentException If the type is illegal.     */    public void removeKey(String key, int type)    {        removeKeys(Collections.singleton(key), type);    }    /**     * Checks if any of the keys in <tt>keys</tt> is in any of the sets of     * keys.     *     * @param keys The set of keys to check.     * @throws IllegalArgumentException If any of the keys in <tt>keys</tt>     *         is in any of the lists of keys.     */    private void checkKeys(Set keys)    {        if (!emptyIntersection(key, keys) ||            !emptyIntersection(keyValue, keys) ||            !emptyIntersection(keyEqualsValue, keys) ||            !emptyIntersection(keyValues, keys))        {            throw new IllegalArgumentException("Duplicate key");        }    }    /**     * Checks whether two sets have an empty intersection.     *     * @param set1 The first set.     * @param set2 The second set.     * @return <tt>true</tt> iff the two sets have no common elements.     */    private static boolean emptyIntersection(Set set1, Set set2)    {        Set intersect = new HashSet(set1);        intersect.retainAll(set2);        return (intersect.size() == 0);    }    /**     * Reads the parameters in <tt>args</tt>, and returns a map.<br>     * The value of the key will be <tt>null</tt> if the key should have     * no value, a string if the key should have exactly one value, and a     * {@link List} of strings if the key can have multiple values.     *     * @param args An array with the parameters.     * @return A map containing the key-value pairs of the parameters.     * @throws IllegalArgumentException If an unknown parameter is found, or a     *         parameter has the wrong number of values.     * @see #addKeys(Set, int)     * @see #addKey(String, int)     */    public Map readParameters(String[] args)    {        Map parameters = new HashMap();        int i = 0; // for traversing args        while (i < args.length)        {            if (key.contains(args[i]))            {                parameters.put(args[i++], null);            }            else if (keyValue.contains(args[i]))            {                if (i < args.length - 1)                {                    parameters.put(args[i], args[i + 1]);                    i += 2;                }                else                {                    // i = args.length - 1, so no value left                    throw new IllegalArgumentException(args[i]);                }            }            else if (keyValues.contains(args[i]))            {                List list = new ArrayList();                parameters.put(args[i++], list);                /*                 * Go on until either the arguments are all used up, or                 * another key is found. In case of keyEqualsValue, split the                 * argument in two parts at "=".                 * args[i].split("=", 2)[0].equals(args[i]) if there is no "="                 * in args[i].                 */                while ((i < args.length) &&                       !key.contains(args[i]) &&                       !keyValue.contains(args[i]) &&                       !keyValues.contains(args[i]) &&                       !keyEqualsValue.contains(args[i].split("=", 2)[0]))                {                    list.add(args[i++]);                }            }            else            {                // either KEY=VALUE or unknown                String[] split = args[i].split("=", 2);                if (split.length == 1)                {                    // no "=", so unknown                    throw new IllegalArgumentException(args[i]);                }                else                {                    if (keyEqualsValue.contains(split[0]))                    {                        parameters.put(split[0], split[1]);                        i++;                    }                    else                    {                        // not known                        throw new IllegalArgumentException(split[0]);                    }                }            }        }        return parameters;    }    /**     * Checks whether only one of the keys in <tt>keys</tt> is set in     * <tt>parameters</tt>.     *     * @param parameters A map with parameters.     * @param keys A set containing keys that should be unique in     *        <tt>parameters</tt>.     * @return <tt>true</tt> iff only one of the keys in <tt>keys</tt>     *         is in <tt>parameters</tt>.     */    public static boolean unique(Map parameters, Set keys)    {        Set intersect = new HashSet(parameters.keySet());        intersect.retainAll(keys);        /*         * intersect is the intersection of keys in parameters and keys in         * keys         */        return (intersect.size() <= 1);        /*         * if the size of intersect is bigger than 1, more than 1 key in keys         * were keys of the map.         */    }    /**     * Checks whether only one of the keys in <tt>keys</tt> is set in     * <tt>parameters</tt>.     *     * @param parameters A map with parameters.     * @param keys A list containing keys that should be unique in     *        <tt>parameters</tt>, in array form.     * @return <tt>true</tt> iff only one of the keys in <tt>keys</tt>     *         is in <tt>parameters</tt>.     */    public static boolean unique(Map parameters, String[] keys)    {        return unique(parameters, new HashSet(Arrays.asList(keys)));    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女视频一区在线观看| 粉嫩一区二区三区在线看| 国产一区二区三区免费看 | 美女爽到高潮91| 99精品欧美一区| 精品久久一区二区| 国产精品成人一区二区三区夜夜夜 | 18涩涩午夜精品.www| 日韩影院在线观看| 日本韩国一区二区| 国产日韩欧美精品综合| 男男成人高潮片免费网站| 在线观看免费视频综合| 国产精品―色哟哟| 美日韩黄色大片| 欧美日韩精品一区二区三区| 中文字幕中文字幕中文字幕亚洲无线| 久久精品国内一区二区三区| 欧美日韩中文一区| 亚洲美女视频一区| 成人黄色免费短视频| 欧美精品一区二区精品网| 香蕉av福利精品导航| 色8久久人人97超碰香蕉987| 亚洲色图一区二区| 北岛玲一区二区三区四区| 亚洲国产精品激情在线观看| 国产真实乱子伦精品视频| 欧美一区二区啪啪| 日韩成人精品在线| 日韩视频免费直播| 美女视频免费一区| 欧美tk—视频vk| 国产一区二区三区精品欧美日韩一区二区三区 | 国产又粗又猛又爽又黄91精品| 欧美一级日韩免费不卡| 奇米精品一区二区三区在线观看一| 69堂国产成人免费视频| 免费成人在线网站| 久久影院午夜论| 国产91对白在线观看九色| 国产精品进线69影院| 96av麻豆蜜桃一区二区| 一区二区三区四区激情| 欧美亚洲动漫制服丝袜| 香蕉久久一区二区不卡无毒影院| 欧美精品丝袜久久久中文字幕| 日本不卡的三区四区五区| 精品久久久久久综合日本欧美| 国产精品99久久久久久久女警| 国产精品久久久久久久久果冻传媒| 91女厕偷拍女厕偷拍高清| 亚洲国产一区二区三区青草影视| 制服丝袜亚洲播放| 激情欧美一区二区三区在线观看| 欧美激情在线一区二区| 欧美综合亚洲图片综合区| 亚洲成人免费看| 国产亚洲一区二区三区| 91欧美一区二区| 青青草国产成人av片免费| 国产亚洲精品aa| 91香蕉视频黄| 免费观看在线色综合| 国产日韩影视精品| 欧美视频一区二区三区| 精品一区二区日韩| 中文字幕亚洲电影| 欧美美女一区二区| 国产一区二区主播在线| 亚洲三级在线观看| 91麻豆精品国产91久久久久久| 高清国产一区二区| 爽好久久久欧美精品| 26uuu国产在线精品一区二区| 欧美做爰猛烈大尺度电影无法无天| 国产一区二区剧情av在线| 亚洲国产美女搞黄色| 久久亚洲欧美国产精品乐播| 91精品办公室少妇高潮对白| 极品瑜伽女神91| 亚洲永久免费av| 国产欧美综合在线观看第十页| 欧美伊人精品成人久久综合97| 国产乱子轮精品视频| 亚洲一区二区三区四区在线| 国产精品久久毛片| 日韩欧美国产综合一区| 色噜噜狠狠一区二区三区果冻| 国产在线一区二区综合免费视频| 午夜精品在线看| 中文字幕色av一区二区三区| 精品国一区二区三区| 欧美视频一区二区三区| 成人aaaa免费全部观看| 国内精品久久久久影院色| 午夜精品一区二区三区三上悠亚| 一色屋精品亚洲香蕉网站| 久久久精品国产免大香伊| 666欧美在线视频| 91免费观看在线| av亚洲精华国产精华精| 国产盗摄视频一区二区三区| 久久精品国产99国产精品| 日韩精品欧美精品| 香蕉加勒比综合久久| 一区二区三区日韩欧美精品| 国产精品美日韩| 欧美国产日韩在线观看| 久久久亚洲精品石原莉奈| 日韩欧美亚洲另类制服综合在线 | 国产精品一区二区在线观看网站 | 久久精品无码一区二区三区| 欧美成人官网二区| 精品久久人人做人人爱| 精品伦理精品一区| 91精品国产欧美日韩| 884aa四虎影成人精品一区| 欧美日韩另类国产亚洲欧美一级| 欧美在线你懂的| 欧美伦理视频网站| 欧美一级日韩一级| 久久久91精品国产一区二区精品| 国产日产精品一区| 中文字幕高清不卡| 亚洲欧美另类在线| 五月婷婷综合在线| 精品一区二区三区在线观看国产| 免费成人av在线播放| 国产精品2024| 97se亚洲国产综合自在线观| 欧美三级日韩在线| 欧美一区欧美二区| 国产婷婷色一区二区三区在线| 亚洲欧洲精品一区二区三区| 一区二区三区在线免费播放| 亚洲成人午夜影院| 韩国女主播一区| 日本韩国一区二区| 精品国产一区二区三区忘忧草 | 国产精品国产三级国产aⅴ原创| 国产欧美精品一区| 亚洲美腿欧美偷拍| 久久国产三级精品| 国产成人午夜精品5599| 国产+成+人+亚洲欧洲自线| 欧美天天综合网| 久久影院电视剧免费观看| 一区二区三区四区中文字幕| 麻豆91在线观看| 色综合久久综合| 欧美一级久久久久久久大片| 欧美国产精品v| 丝袜美腿高跟呻吟高潮一区| 国产精品一卡二| 欧美日韩一区二区三区高清| 26uuu成人网一区二区三区| 亚洲欧美成人一区二区三区| 毛片不卡一区二区| 色婷婷av一区二区三区之一色屋| 日韩一二三区不卡| 一区二区三区欧美激情| 国产精品一二三四五| 欧美日韩精品专区| 亚洲视频中文字幕| 国产成人午夜视频| 日韩欧美第一区| 亚洲一区二区三区爽爽爽爽爽 | 国产一区二区三区日韩| 欧美丝袜丝nylons| 亚洲欧洲精品天堂一级| 韩国av一区二区三区四区 | 亚洲国产高清不卡| 久久99热99| 欧美精品v国产精品v日韩精品| 国产精品久久看| 国产成人精品www牛牛影视| 在线不卡免费av| 一区二区三区四区在线免费观看 | 美女一区二区视频| 日本电影欧美片| 中文字幕一区不卡| 国产精品一卡二卡在线观看| 制服丝袜在线91| 偷偷要91色婷婷| 欧美撒尿777hd撒尿| 一区二区三区在线高清| 色综合久久久久久久久| 国产精品久久久久婷婷| 国产精品自拍在线| 久久天天做天天爱综合色| 另类小说图片综合网| 欧美日韩免费一区二区三区| 亚洲狼人国产精品| 在线精品视频一区二区| 中文字幕日韩一区| 国产精品中文字幕一区二区三区| 91精品麻豆日日躁夜夜躁| 午夜精品爽啪视频| 在线播放中文一区|