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

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

?? keytogroupmap.java

?? jfreechart1.0.1 jsp繪制圖表的開發(fā)包
?? JAVA
字號(hào):
/* ===========================================================
 * JFreeChart : a free chart library for the Java(tm) platform
 * ===========================================================
 *
 * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
 *
 * Project Info:  http://www.jfree.org/jfreechart/index.html
 *
 * This library is free software; you can redistribute it and/or modify it 
 * under the terms of the GNU Lesser General Public License as published by 
 * the Free Software Foundation; either version 2.1 of the License, or 
 * (at your option) any later version.
 *
 * This library 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 Lesser General Public 
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 * USA.  
 *
 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
 * in the United States and other countries.]
 *
 * ------------------
 * KeyToGroupMap.java
 * ------------------
 * (C) Copyright 2004, 2005, by Object Refinery Limited and Contributors.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: KeyToGroupMap.java,v 1.7.2.2 2005/10/25 21:29:13 mungady Exp $
 *
 * Changes
 * -------
 * 29-Apr-2004 : Version 1 (DG);
 * 07-Jul-2004 : Added a group list to ensure group index is consistent, fixed 
 *               cloning problem (DG);
 * 18-Aug-2005 : Added casts in clone() method to suppress 1.5 compiler 
 *               warnings - see patch 1260587 (DG);
 * 
 */

package org.jfree.data;

import java.io.Serializable;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.jfree.util.ObjectUtilities;
import org.jfree.util.PublicCloneable;

/**
 * A class that maps keys (instances of <code>Comparable</code>) to groups.
 */
public class KeyToGroupMap implements Cloneable, PublicCloneable, Serializable {
    
    /** For serialization. */
    private static final long serialVersionUID = -2228169345475318082L;
    
    /** The default group. */
    private Comparable defaultGroup;
    
    /** The groups. */
    private List groups;
    
    /** A mapping between keys and groups. */
    private Map keyToGroupMap;
    
    /**
     * Creates a new map with a default group named 'Default Group'.
     */
    public KeyToGroupMap() {
        this("Default Group");
    }
    
    /**
     * Creates a new map with the specified default group.
     * 
     * @param defaultGroup  the default group (<code>null</code> not permitted).
     */
    public KeyToGroupMap(Comparable defaultGroup) {
        if (defaultGroup == null) {
            throw new IllegalArgumentException("Null 'defaultGroup' argument.");
        }
        this.defaultGroup = defaultGroup;
        this.groups = new ArrayList();
        this.keyToGroupMap = new HashMap();
    }
    
    /**
     * Returns the number of groups in the map.
     * 
     * @return The number of groups in the map.
     */
    public int getGroupCount() {
        return this.groups.size() + 1;
    }
    
    /**
     * Returns a list of the groups (always including the default group) in the 
     * map.  The returned list is independent of the map, so altering the list 
     * will have no effect.
     * 
     * @return The groups (never <code>null</code>).
     */
    public List getGroups() {
        List result = new ArrayList();
        result.add(this.defaultGroup);
        Iterator iterator = this.groups.iterator();
        while (iterator.hasNext()) {
            Comparable group = (Comparable) iterator.next();
            if (!result.contains(group)) {
                result.add(group);   
            }
        } 
        return result;
    }
    
    /**
     * Returns the index for the group.
     * 
     * @param group  the group.
     * 
     * @return The group index (or -1 if the group is not represented within 
     *         the map).
     */
    public int getGroupIndex(Comparable group) {
        int result = this.groups.indexOf(group);
        if (result < 0) {
            if (this.defaultGroup.equals(group)) {
                result = 0;
            }
        }
        else {
            result = result + 1;   
        }
        return result;   
    }
    
    /**
     * Returns the group that a key is mapped to.
     * 
     * @param key  the key (<code>null</code> not permitted).
     * 
     * @return The group (never <code>null</code>, returns the default group if
     *         there is no mapping for the specified key).
     */
    public Comparable getGroup(Comparable key) {
        if (key == null) {
            throw new IllegalArgumentException("Null 'key' argument.");   
        }
        Comparable result = this.defaultGroup;
        Comparable group = (Comparable) this.keyToGroupMap.get(key);
        if (group != null) {
            result = group;   
        }
        return result;
    }
    
    /**
     * Maps a key to a group.
     * 
     * @param key  the key (<code>null</code> not permitted).
     * @param group  the group (<code>null</code> permitted, clears any 
     *               existing mapping).
     */
    public void mapKeyToGroup(Comparable key, Comparable group) {
        if (key == null) {
            throw new IllegalArgumentException("Null 'key' argument.");   
        }
        Comparable currentGroup = getGroup(key);
        if (!currentGroup.equals(this.defaultGroup)) {
            if (!currentGroup.equals(group)) {
                int count = getKeyCount(currentGroup);
                if (count == 1) {
                    this.groups.remove(currentGroup);   
                }
            }
        }
        if (group == null) {
            this.keyToGroupMap.remove(key); 
        }
        else {
            if (!this.groups.contains(group)) {
                if (!this.defaultGroup.equals(group)) {
                    this.groups.add(group);
                }
            }
            this.keyToGroupMap.put(key, group);
        }
    }
    
    /**
     * Returns the number of keys mapped to the specified group.  This method 
     * won't always return an accurate result for the default group, since 
     * explicit mappings are not required for this group.
     * 
     * @param group  the group (<code>null</code> not permitted).
     * 
     * @return The key count.
     */
    public int getKeyCount(Comparable group) {
        if (group == null) {
            throw new IllegalArgumentException("Null 'group' argument.");   
        }
        int result = 0;
        Iterator iterator = this.keyToGroupMap.values().iterator();
        while (iterator.hasNext()) {
            Comparable g = (Comparable) iterator.next();
            if (group.equals(g)) {
                result++;
            }
        }
        return result;
    }
    
    /**
     * Tests the map for equality against an arbitrary object.
     * 
     * @param obj  the object to test against (<code>null</code> permitted).
     * 
     * @return A boolean.
     */
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;      
        }
        if (!(obj instanceof KeyToGroupMap)) {
            return false;
        }
        KeyToGroupMap that = (KeyToGroupMap) obj;
        if (!ObjectUtilities.equal(this.defaultGroup, that.defaultGroup)) {
            return false;
        }
        if (!this.keyToGroupMap.equals(that.keyToGroupMap)) {
            return false;
        }
        return true;
    }
    
    /**
     * Returns a clone of the map.
     * 
     * @return A clone.
     * 
     * @throws CloneNotSupportedException  if there is a problem cloning the
     *                                     map.
     */
    public Object clone() throws CloneNotSupportedException {
        KeyToGroupMap result = (KeyToGroupMap) super.clone();
        result.defaultGroup 
            = (Comparable) KeyToGroupMap.clone(this.defaultGroup);
        result.groups = (List) KeyToGroupMap.clone(this.groups);
        result.keyToGroupMap = (Map) KeyToGroupMap.clone(this.keyToGroupMap);
        return result;
    }
    
    /**
     * Attempts to clone the specified object using reflection.
     * 
     * @param object  the object (<code>null</code> permitted).
     * 
     * @return The cloned object, or the original object if cloning failed.
     */
    private static Object clone(Object object) {
        if (object == null) {
            return null;   
        }
        Class c = object.getClass();
        Object result = null;
        try {
            Method m = c.getMethod("clone", (Class[]) null);
            if (Modifier.isPublic(m.getModifiers())) {
                try {
                    result = m.invoke(object, (Object[]) null);
                }
                catch (Exception e) {
                    e.printStackTrace();  
                }
            }
        }
        catch (NoSuchMethodException e) {
            result = object;
        }
        return result;
    }
    
    /**
     * Returns a clone of the list.
     * 
     * @param list  the list.
     * 
     * @return A clone of the list.
     * 
     * @throws CloneNotSupportedException if the list could not be cloned.
     */
    private static Collection clone(Collection list) 
        throws CloneNotSupportedException {
        Collection result = null;
        if (list != null) {
            try {
                List clone = (List) list.getClass().newInstance();
                Iterator iterator = list.iterator();
                while (iterator.hasNext()) {
                    clone.add(KeyToGroupMap.clone(iterator.next()));
                }
                result = clone;
            }
            catch (Exception e) {
                throw new CloneNotSupportedException("Exception.");
            }
        }
        return result;
    }

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产99久久久久久免费看农村| 99免费精品在线| 韩国欧美国产1区| 国产宾馆实践打屁股91| 91在线视频播放| 欧美一区日韩一区| 国产精品视频在线看| 日韩精品欧美精品| 成人免费视频一区| 在线成人午夜影院| 久久精品亚洲精品国产欧美| 国产精品久久久久久久久免费樱桃| 亚洲激情图片qvod| 夫妻av一区二区| 3d成人动漫网站| 亚洲女人小视频在线观看| 精品在线一区二区三区| 日本道在线观看一区二区| 久久久一区二区| 美女视频一区二区| 91麻豆精品在线观看| 欧美成人在线直播| 亚洲成av人影院在线观看网| 9l国产精品久久久久麻豆| 欧美军同video69gay| 亚洲精品国产第一综合99久久| 国产白丝网站精品污在线入口| 日韩精品专区在线影院重磅| 亚洲影院免费观看| 97超碰欧美中文字幕| 国产欧美一区二区精品秋霞影院| 亚洲女同女同女同女同女同69| 久久99精品国产麻豆不卡| 欧美日韩卡一卡二| 亚洲午夜免费视频| 欧美午夜精品久久久久久超碰 | 国产精品久久久久久久久晋中| 中文字幕一区av| 国产成人综合在线播放| 欧美成人激情免费网| 日本一道高清亚洲日美韩| 欧美日韩一区二区三区高清| 国产免费观看久久| 丰满少妇久久久久久久| 久久久www成人免费毛片麻豆| 麻豆精品在线看| 91精品免费观看| 日日摸夜夜添夜夜添亚洲女人| 欧美三级在线视频| 丝袜美腿成人在线| 日韩一区二区三免费高清| 亚洲一区二区成人在线观看| 欧美日韩五月天| 肉色丝袜一区二区| 日韩午夜精品视频| 久久精品国产**网站演员| 精品欧美乱码久久久久久| 久久精品国产99国产精品| 久久综合九色综合欧美98| 国产麻豆精品视频| 国产欧美视频在线观看| 成人免费视频一区| 欧美国产视频在线| 成人白浆超碰人人人人| 国产精品乱子久久久久| 91免费版在线看| 日韩精品免费视频人成| 精品国产乱码久久久久久老虎| 国产91色综合久久免费分享| 亚洲女与黑人做爰| 欧美一区二区在线免费观看| 久草这里只有精品视频| 中文字幕欧美日本乱码一线二线| 一本一本久久a久久精品综合麻豆| 一区二区三区日韩欧美| 日韩欧美国产一二三区| 成人精品免费网站| 亚洲男同1069视频| 91精品国产色综合久久ai换脸 | 欧美大片日本大片免费观看| 国产一区二区伦理| 一区二区三区自拍| 欧美成人一区二区三区片免费 | 国产精品久久久久久久久搜平片| 在线看国产一区| 亚洲第一久久影院| 国产精品无人区| 欧美一区中文字幕| 91一区在线观看| 九九精品一区二区| 一区二区三区精品视频在线| 日韩精品一区二区三区在线| 91麻豆swag| 精品系列免费在线观看| 一区二区在线看| 国产亚洲美州欧州综合国| 在线国产电影不卡| 国产成人av电影在线播放| 亚洲欧洲日韩在线| 91麻豆精品国产91久久久资源速度 | 日韩一区在线看| 欧美videossexotv100| 国产凹凸在线观看一区二区| 亚洲色图视频网| 丰满岳乱妇一区二区三区| 中文字幕亚洲区| 国精产品一区一区三区mba桃花| 国产精品免费免费| 欧美一区二区大片| 日韩欧美色综合网站| 91精品国产丝袜白色高跟鞋| 日韩美一区二区三区| 精品国产成人系列| 国产欧美视频在线观看| 欧美sm美女调教| 欧美一区二区三区视频免费播放| 91麻豆成人久久精品二区三区| 成人国产精品视频| 欧美日韩一二三区| 欧美久久免费观看| 国产99精品在线观看| 国产色产综合色产在线视频| 日韩欧美国产高清| 日韩高清在线一区| 亚洲国产视频网站| 精品国产区一区| 国产精品电影院| 中文字幕第一区二区| 久久九九99视频| 欧美一区二区在线视频| 欧美性大战久久久| 欧洲精品一区二区三区在线观看| caoporm超碰国产精品| 国产精品亚洲综合一区在线观看| 美女www一区二区| 国产大陆亚洲精品国产| 色综合久久66| 欧美一区二区三区播放老司机| 欧美精品一区二区在线观看| 国产精品免费丝袜| 亚洲成人免费视| 国产一区二区在线观看视频| 97久久人人超碰| 欧美一区永久视频免费观看| 国产色一区二区| 香蕉成人伊视频在线观看| 国产一区二区三区在线观看精品| 不卡的av电影在线观看| 欧美日韩免费观看一区二区三区 | 亚洲午夜精品网| 韩国三级中文字幕hd久久精品| 99精品桃花视频在线观看| 91精品国产品国语在线不卡| 亚洲国产精品黑人久久久| 玉米视频成人免费看| 国产在线精品不卡| 在线免费视频一区二区| 久久精品亚洲麻豆av一区二区| 亚洲一区在线视频观看| 国产精品伊人色| 欧美日韩免费不卡视频一区二区三区| 精品国产污污免费网站入口 | 亚洲色图清纯唯美| 国产在线不卡一卡二卡三卡四卡| 欧美在线三级电影| 国产精品入口麻豆原神| 琪琪久久久久日韩精品| 日本精品视频一区二区| 国产日韩欧美高清在线| 麻豆成人在线观看| 欧美日韩午夜在线| 亚洲另类春色校园小说| 国产成人一级电影| 精品国产乱码久久久久久蜜臀| 亚洲成人精品影院| 91免费国产在线| 国产精品久久久久一区二区三区| 精品一区二区三区免费| 欧美日韩黄色一区二区| 亚洲激情一二三区| 99精品热视频| 中文字幕在线观看不卡视频| 国产伦精品一区二区三区在线观看| 制服丝袜成人动漫| 亚洲影视在线播放| 日本国产一区二区| 亚洲欧洲综合另类在线| 91天堂素人约啪| 国产精品久久网站| 成人网在线免费视频| 亚洲高清免费一级二级三级| 色婷婷激情久久| 亚洲日本电影在线| caoporm超碰国产精品| 国产精品福利一区二区三区| 高清免费成人av| 国产精品短视频| 在线看国产一区二区| 亚洲一二三区在线观看| 欧美日韩视频在线第一区|