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

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

?? defaultkeyedvaluestests.java

?? jfreechart1.0.1 jsp繪制圖表的開發(fā)包
?? JAVA
字號:
/* ===========================================================
 * 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.]
 *
 * ----------------------------
 * DefaultKeyedValuesTests.java
 * ----------------------------
 * (C) Copyright 2003-2005, by Object Refinery Limited.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: DefaultKeyedValuesTests.java,v 1.6.2.2 2005/10/25 21:34:07 mungady Exp $
 *
 * Changes
 * -------
 * 05-Mar-2003 : Version 1 (DG);
 * 27-Aug-2003 : Moved SortOrder from org.jfree.data --> org.jfree.util (DG);
 *
 */

package org.jfree.data.junit;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.jfree.data.DefaultKeyedValues;
import org.jfree.util.SortOrder;

/**
 * Tests for the {@link DefaultKeyedValues} class.
 */
public class DefaultKeyedValuesTests extends TestCase {

    /**
     * Returns the tests as a test suite.
     *
     * @return The test suite.
     */
    public static Test suite() {
        return new TestSuite(DefaultKeyedValuesTests.class);
    }

    /**
     * Constructs a new set of tests.
     *
     * @param name  the name of the tests.
     */
    public DefaultKeyedValuesTests(String name) {
        super(name);
    }

    /**
     * Common test setup.
     */
    protected void setUp() {
        // no setup required
    }
    
    /**
     * Some checks for the getValue() methods.
     */
    public void testGetValue() {
        DefaultKeyedValues v1 = new DefaultKeyedValues();
        try {
            /* Number n = */ v1.getValue(-1);
            assertTrue(false);
        }
        catch (IndexOutOfBoundsException e) {
            // expected
        }
        try {
            /* Number n = */ v1.getValue(0);
            assertTrue(false);
        }
        catch (IndexOutOfBoundsException e) {
            // expected
        }
        DefaultKeyedValues v2 = new DefaultKeyedValues();
        v2.addValue("K1", new Integer(1));
        v2.addValue("K2", new Integer(2));
        v2.addValue("K3", new Integer(3));
        assertEquals(new Integer(3), v2.getValue(2));
    }

    /**
     * Some checks for the getKey() methods.
     */
    public void testGetKey() {
        DefaultKeyedValues v1 = new DefaultKeyedValues();
        try {
            /* Comparable k = */ v1.getKey(-1);
            assertTrue(false);
        }
        catch (IndexOutOfBoundsException e) {
            // expected
        }
        try {
            /* Comparable k = */ v1.getKey(0);
            assertTrue(false);
        }
        catch (IndexOutOfBoundsException e) {
            // expected
        }
        DefaultKeyedValues v2 = new DefaultKeyedValues();
        v2.addValue("K1", new Integer(1));
        v2.addValue("K2", new Integer(2));
        v2.addValue("K3", new Integer(3));
        assertEquals("K2", v2.getKey(1));
    }

    /**
     * Some checks for the getKey() methods.
     */
    public void testGetIndex() {
        DefaultKeyedValues v1 = new DefaultKeyedValues();
        assertEquals(-1, v1.getIndex("K1"));

        DefaultKeyedValues v2 = new DefaultKeyedValues();
        v2.addValue("K1", new Integer(1));
        v2.addValue("K2", new Integer(2));
        v2.addValue("K3", new Integer(3));
        assertEquals(2, v2.getIndex("K3"));
    }
    
    /**
     * Some checks for the clone() method.
     */
    public void testCloning() {
        DefaultKeyedValues v1 = new DefaultKeyedValues();
        v1.addValue("V1", new Integer(1));
        v1.addValue("V2", null);
        v1.addValue("V3", new Integer(3));
        DefaultKeyedValues v2 = null;
        try {
            v2 = (DefaultKeyedValues) v1.clone();
        }
        catch (CloneNotSupportedException e) {
            System.err.println("Failed to clone.");
        }
        assertTrue(v1 != v2);
        assertTrue(v1.getClass() == v2.getClass());
        assertTrue(v1.equals(v2));
        
        // confirm that the clone is independent of the original
        v2.setValue("V1", new Integer(44));
        assertFalse(v1.equals(v2));
    }
    
    /**
     * Check that inserting and retrieving values works as expected.
     */
    public void testInsertAndRetrieve() {

        DefaultKeyedValues data = new DefaultKeyedValues();
        data.addValue("A", new Double(1.0));
        data.addValue("B", new Double(2.0));
        data.addValue("C", new Double(3.0));
        data.addValue("D", null);

        // check key order
        assertEquals(data.getKey(0), "A");
        assertEquals(data.getKey(1), "B");
        assertEquals(data.getKey(2), "C");
        assertEquals(data.getKey(3), "D");

        // check retrieve value by key
        assertEquals(data.getValue("A"), new Double(1.0));
        assertEquals(data.getValue("B"), new Double(2.0));
        assertEquals(data.getValue("C"), new Double(3.0));
        assertEquals(data.getValue("D"), null);

        // check retrieve value by index
        assertEquals(data.getValue(0), new Double(1.0));
        assertEquals(data.getValue(1), new Double(2.0));
        assertEquals(data.getValue(2), new Double(3.0));
        assertEquals(data.getValue(3), null);

    }

    /**
     * Some tests for the removeValue() method.
     */
    public void testRemoveValue() {
        DefaultKeyedValues data = new DefaultKeyedValues();
        data.addValue("A", new Double(1.0));
        data.addValue("B", null);
        data.addValue("C", new Double(3.0));
        data.addValue("D", new Double(2.0));
        assertEquals(1, data.getIndex("B"));
        data.removeValue("B");
        assertEquals(-1, data.getIndex("B"));
        
        boolean pass = true;
        try {
            data.removeValue("XXX");
        }
        catch (Exception e) {
            pass = false;   
        }
        assertTrue(pass);
    }
    
    /**
     * Tests sorting of data by key (ascending).
     */
    public void testSortByKeyAscending() {

        DefaultKeyedValues data = new DefaultKeyedValues();
        data.addValue("C", new Double(1.0));
        data.addValue("B", null);
        data.addValue("D", new Double(3.0));
        data.addValue("A", new Double(2.0));

        data.sortByKeys(SortOrder.ASCENDING);

        // check key order
        assertEquals(data.getKey(0), "A");
        assertEquals(data.getKey(1), "B");
        assertEquals(data.getKey(2), "C");
        assertEquals(data.getKey(3), "D");

        // check retrieve value by key
        assertEquals(data.getValue("A"), new Double(2.0));
        assertEquals(data.getValue("B"), null);
        assertEquals(data.getValue("C"), new Double(1.0));
        assertEquals(data.getValue("D"), new Double(3.0));

        // check retrieve value by index
        assertEquals(data.getValue(0), new Double(2.0));
        assertEquals(data.getValue(1), null);
        assertEquals(data.getValue(2), new Double(1.0));
        assertEquals(data.getValue(3), new Double(3.0));

    }

    /**
     * Tests sorting of data by key (descending).
     */
    public void testSortByKeyDescending() {

        DefaultKeyedValues data = new DefaultKeyedValues();
        data.addValue("C", new Double(1.0));
        data.addValue("B", null);
        data.addValue("D", new Double(3.0));
        data.addValue("A", new Double(2.0));

        data.sortByKeys(SortOrder.DESCENDING);

        // check key order
        assertEquals(data.getKey(0), "D");
        assertEquals(data.getKey(1), "C");
        assertEquals(data.getKey(2), "B");
        assertEquals(data.getKey(3), "A");

        // check retrieve value by key
        assertEquals(data.getValue("A"), new Double(2.0));
        assertEquals(data.getValue("B"), null);
        assertEquals(data.getValue("C"), new Double(1.0));
        assertEquals(data.getValue("D"), new Double(3.0));

        // check retrieve value by index
        assertEquals(data.getValue(0), new Double(3.0));
        assertEquals(data.getValue(1), new Double(1.0));
        assertEquals(data.getValue(2), null);
        assertEquals(data.getValue(3), new Double(2.0));

    }

    /**
     * Tests sorting of data by value (ascending).
     */
    public void testSortByValueAscending() {

        DefaultKeyedValues data = new DefaultKeyedValues();
        data.addValue("C", new Double(1.0));
        data.addValue("B", null);
        data.addValue("D", new Double(3.0));
        data.addValue("A", new Double(2.0));

        data.sortByValues(SortOrder.ASCENDING);

        // check key order
        assertEquals(data.getKey(0), "C");
        assertEquals(data.getKey(1), "A");
        assertEquals(data.getKey(2), "D");
        assertEquals(data.getKey(3), "B");

        // check retrieve value by key
        assertEquals(data.getValue("A"), new Double(2.0));
        assertEquals(data.getValue("B"), null);
        assertEquals(data.getValue("C"), new Double(1.0));
        assertEquals(data.getValue("D"), new Double(3.0));

        // check retrieve value by index
        assertEquals(data.getValue(0), new Double(1.0));
        assertEquals(data.getValue(1), new Double(2.0));
        assertEquals(data.getValue(2), new Double(3.0));
        assertEquals(data.getValue(3), null);

    }

    /**
     * Tests sorting of data by key (descending).
     */
    public void testSortByValueDescending() {

        DefaultKeyedValues data = new DefaultKeyedValues();
        data.addValue("C", new Double(1.0));
        data.addValue("B", null);
        data.addValue("D", new Double(3.0));
        data.addValue("A", new Double(2.0));

        data.sortByValues(SortOrder.DESCENDING);

        // check key order
        assertEquals(data.getKey(0), "D");
        assertEquals(data.getKey(1), "A");
        assertEquals(data.getKey(2), "C");
        assertEquals(data.getKey(3), "B");

        // check retrieve value by key
        assertEquals(data.getValue("A"), new Double(2.0));
        assertEquals(data.getValue("B"), null);
        assertEquals(data.getValue("C"), new Double(1.0));
        assertEquals(data.getValue("D"), new Double(3.0));

        // check retrieve value by index
        assertEquals(data.getValue(0), new Double(3.0));
        assertEquals(data.getValue(1), new Double(2.0));
        assertEquals(data.getValue(2), new Double(1.0));
        assertEquals(data.getValue(3), null);

    }

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        DefaultKeyedValues v1 = new DefaultKeyedValues();
        v1.addValue("Key 1", new Double(23));
        v1.addValue("Key 2", null);
        v1.addValue("Key 3", new Double(42));

        DefaultKeyedValues v2 = null;

        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(v1);
            out.close();

            ObjectInput in = new ObjectInputStream(
                new ByteArrayInputStream(buffer.toByteArray())
            );
            v2 = (DefaultKeyedValues) in.readObject();
            in.close();
        }
        catch (Exception e) {
            System.out.println(e.toString());
        }
        assertEquals(v1, v2);

    }

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美白人最猛性xxxxx69交| 国产不卡高清在线观看视频| 国产精品麻豆一区二区| 国产精品视频一二三| 国产三级精品视频| 国产网红主播福利一区二区| 日韩欧美激情一区| 国产精品伦一区| 亚洲丝袜自拍清纯另类| 一区二区三区在线观看欧美| 亚洲精品久久久蜜桃| 舔着乳尖日韩一区| 国产美女在线精品| 一本色道**综合亚洲精品蜜桃冫| 972aa.com艺术欧美| 欧美挠脚心视频网站| 精品久久人人做人人爰| 亚洲色图20p| 免费看日韩a级影片| www.亚洲精品| 日韩视频国产视频| 亚洲色图.com| 韩国成人在线视频| 欧美日韩黄色一区二区| 国产欧美日韩精品一区| 免费精品视频在线| 97久久精品人人做人人爽50路| 欧美一区二区精品久久911| 国产精品久久久久久久久免费相片| 亚洲一区二区三区三| 丰满放荡岳乱妇91ww| 精品国产免费一区二区三区香蕉| 亚洲欧美色图小说| 成人一区二区视频| 中文字幕不卡的av| 国产一区二区伦理| 久久品道一品道久久精品| 日韩高清一级片| 欧美日韩一区二区三区四区 | www国产精品av| 日韩精品久久久久久| 欧美性猛交xxxxxxxx| 一区二区三区鲁丝不卡| 在线影院国内精品| 亚洲另类在线视频| 欧美三级视频在线| 亚洲成a人片在线不卡一二三区 | 久久久久久久综合狠狠综合| 免费久久精品视频| 久久久久久9999| 北条麻妃国产九九精品视频| 亚洲欧美日韩综合aⅴ视频| 91蜜桃在线免费视频| 亚洲自拍另类综合| 欧美电影免费观看高清完整版在线观看| 天天免费综合色| 国产日产精品一区| 在线欧美日韩国产| 国产尤物一区二区在线| 日韩伦理电影网| 日韩免费福利电影在线观看| 国产不卡一区视频| 亚洲国产三级在线| 国产精品网站一区| 欧美一区二区三区小说| av在线免费不卡| 日本最新不卡在线| 日韩伦理免费电影| 精品国产乱码91久久久久久网站| 波多野结衣亚洲| 国产一区二区三区最好精华液| 日韩美女视频一区二区| 26uuu亚洲| 337p亚洲精品色噜噜狠狠| 成人激情动漫在线观看| 久久精品国产亚洲aⅴ| 亚洲v中文字幕| 亚洲人被黑人高潮完整版| 国产日产欧美一区二区视频| 欧美人牲a欧美精品| 91久久精品网| 色偷偷久久一区二区三区| 国产乱淫av一区二区三区| 五月天一区二区| 三级一区在线视频先锋| 亚洲自拍偷拍图区| 亚洲成av人片| 日韩精品国产精品| 久久国产麻豆精品| 国产经典欧美精品| 成人高清视频在线| 欧美专区日韩专区| 欧美色精品在线视频| 在线91免费看| 日韩精品一区二区三区老鸭窝| 91精品国产综合久久精品app| 在线精品亚洲一区二区不卡| 欧美精品一级二级| 久久久美女毛片| 国产精品久久99| 日韩精品一二区| 精品在线播放免费| 91丨porny丨国产入口| 日本高清不卡aⅴ免费网站| 3d动漫精品啪啪1区2区免费 | 日韩经典中文字幕一区| 久久国产乱子精品免费女| jlzzjlzz亚洲女人18| 欧美午夜影院一区| 国产亚洲欧洲997久久综合 | 91成人看片片| 国产亚洲美州欧州综合国| 一区二区三区欧美在线观看| 青青草国产精品97视觉盛宴| 成人ar影院免费观看视频| 欧美一区二区三区免费观看视频| 日本一区二区综合亚洲| 奇米影视7777精品一区二区| 成人免费的视频| 26uuu另类欧美| 日本sm残虐另类| 欧美猛男超大videosgay| 中文字幕免费不卡在线| 国产一区二区三区在线观看免费视频 | 亚洲精品ww久久久久久p站| 美女一区二区三区在线观看| 91国产成人在线| 亚洲视频香蕉人妖| 国产成人一区二区精品非洲| 欧美成人免费网站| 精品一区二区日韩| 久久久久久久一区| 国产一区二区91| 国产精品久久久久影院色老大| 美国毛片一区二区三区| 日韩精品中文字幕一区二区三区| 亚洲综合成人在线视频| 欧美三级中文字幕| 美脚の诱脚舐め脚责91| 久久先锋影音av鲁色资源网| 国产一区高清在线| 最好看的中文字幕久久| 精品视频一区二区不卡| 免费人成黄页网站在线一区二区| 日韩一级免费观看| 高清视频一区二区| 亚洲欧美另类久久久精品| 欧美亚日韩国产aⅴ精品中极品| 亚洲一区在线播放| 久久久久青草大香线综合精品| 成人一区二区视频| 日韩国产精品大片| 亚洲人成7777| 日韩欧美亚洲一区二区| 不卡av在线网| 免费欧美在线视频| 亚洲人成在线播放网站岛国 | 蜜芽一区二区三区| 国产精品高清亚洲| 精品国产三级电影在线观看| 91麻豆国产在线观看| 国产成人综合网| 久久国产日韩欧美精品| 一区二区三区成人在线视频| 国产午夜精品美女毛片视频| 欧美精品在线观看播放| 91伊人久久大香线蕉| 日本韩国一区二区三区| 久久精品国产**网站演员| 亚洲综合激情小说| 亚洲精品成人少妇| 一区二区三区视频在线观看| 最新成人av在线| 亚洲精品美国一| 亚洲精品中文字幕在线观看| 国产精品午夜免费| 中文字幕日韩欧美一区二区三区| 欧美国产欧美亚州国产日韩mv天天看完整| 欧美天堂亚洲电影院在线播放| 91久久精品一区二区三| 91福利国产精品| 91麻豆精品国产91久久久久久 | 天堂在线亚洲视频| 日本欧美加勒比视频| 蜜桃视频一区二区三区| 捆绑调教美女网站视频一区| 狠狠色狠狠色综合日日91app| 久久国产免费看| 91麻豆精品久久久久蜜臀| 欧美日韩情趣电影| 精品欧美久久久| 中文字幕永久在线不卡| 亚洲电影一区二区| 久久精品国产第一区二区三区| 国产真实精品久久二三区| jlzzjlzz亚洲日本少妇| 69堂亚洲精品首页| 久久精品亚洲乱码伦伦中文| 依依成人综合视频| 国产精品一二三区在线|