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

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

?? segmentedtimelinetests.java

?? Web圖形化的Java庫
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
            if (d < timeline.getSegmentsIncluded()) {
                // should be an included segment
                assertTrue(segment.inIncludeSegments());
                assertTrue(!segment.inExcludeSegments());
                assertTrue(!segment.inExceptionSegments());
            } 
            else {
                // should be an excluded segment
                assertTrue(!segment.inIncludeSegments());
                assertTrue(segment.inExcludeSegments());
                assertTrue(!segment.inExceptionSegments());
            }
            segment.inc();
        }
    }

    //////////////////////////////////////////////////////////////////////////
    // test exception segments
    //////////////////////////////////////////////////////////////////////////

    /**
     * Tests methods related to exceptions methods in the msTimeline.
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void testMsExceptionSegments() throws ParseException {
        verifyExceptionSegments(msTimeline, MS_EXCEPTIONS, NUMBER_FORMAT);
    }

    /**
     * Tests methods related to exceptions methods in the ms2BaseTimeline.
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void testMs2BaseTimelineExceptionSegments() throws ParseException {
        verifyExceptionSegments(ms2BaseTimeline, MS2_BASE_TIMELINE_EXCEPTIONS, NUMBER_FORMAT);
    }

    /**
     * Tests methods related to exceptions methods in the mondayFridayTimeline.
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void testMondayThoughFridayExceptionSegments() throws ParseException {
        verifyExceptionSegments(mondayFridayTimeline, US_HOLIDAYS, DATE_FORMAT);
    }

    /**
     * Tests methods related to exceptions methods in the fifteenMinTimeline.
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void testFifteenMinExceptionSegments() throws ParseException {
        verifyExceptionSegments(fifteenMinTimeline, FIFTEEN_MIN_EXCEPTIONS, DATE_TIME_FORMAT);
    }

    /**
     * Tests methods related to adding exceptions.
     * 
     * @param timeline the timeline to verify
     * @param exceptionString array of Strings that represent the exceptions
     * @param fmt Format object that can parse the exceptionString strings
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void verifyExceptionSegments(SegmentedTimeline timeline,
                                        String[] exceptionString,
                                        Format fmt)
        throws ParseException {

        // fill in the exceptions
        long[] exception = verifyFillInExceptions(timeline, exceptionString, fmt);

        int m = exception.length;

        // verify list of exceptions
        assertEquals(exception.length, timeline.getExceptionSegments().size());
        SegmentedTimeline.Segment lastSegment = timeline.getSegment(exception[m - 1]);
        for (int i = 0; i < m; i++) {
            SegmentedTimeline.Segment segment = timeline.getSegment(exception[i]);
            assertTrue(segment.inExceptionSegments());
            // include current exception and last one
            assertEquals(m - i, timeline.getExceptionSegmentCount(
                segment.getSegmentStart(), lastSegment.getSegmentEnd()));
            // exclude current exception and last one
            assertEquals(Math.max(0, m - i - 2), timeline.getExceptionSegmentCount(
                exception[i] + 1, exception[m - 1] - 1));
        }

    }

    //////////////////////////////////////////////////////////////////////////
    // test timeline translations
    //////////////////////////////////////////////////////////////////////////

    /**
     * Tests translations for 1-ms timeline
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void testMsTranslations() throws ParseException {
        verifyFillInExceptions(msTimeline, MS_EXCEPTIONS, NUMBER_FORMAT);
        verifyTranslations(msTimeline, 0);
    }

    /**
     * Tests translations for the base timeline used for the ms2Timeline
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void testMs2BaseTimelineTranslations() throws ParseException {
        verifyFillInExceptions(ms2BaseTimeline, MS2_BASE_TIMELINE_EXCEPTIONS, NUMBER_FORMAT);
        verifyTranslations(ms2BaseTimeline, 0);
    }

    /**
     * Tests translations for the Monday through Friday timeline
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void testMs2Translations() throws ParseException {
        fillInBaseTimelineExceptions(ms2Timeline, MS2_BASE_TIMELINE_EXCEPTIONS, NUMBER_FORMAT);
        fillInBaseTimelineExclusionsAsExceptions(ms2Timeline, 0, 5000);
        verifyTranslations(ms2Timeline, 1);
    }

    /**
     * Tests translations for the Monday through Friday timeline
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void testMondayThroughFridayTranslations() throws ParseException {
        verifyFillInExceptions(mondayFridayTimeline, US_HOLIDAYS, DATE_FORMAT);
        verifyTranslations(mondayFridayTimeline, monday.getTime().getTime());
    }

    /**
     * Tests translations for the Fifteen Min timeline
     * 
     * @throws ParseException if there is a parsing error.
     */
    public void testFifteenMinTranslations() throws ParseException {
        verifyFillInExceptions(fifteenMinTimeline, FIFTEEN_MIN_EXCEPTIONS, DATE_TIME_FORMAT);
        fillInBaseTimelineExceptions(fifteenMinTimeline, US_HOLIDAYS, DATE_FORMAT);
        fillInBaseTimelineExclusionsAsExceptions(fifteenMinTimeline,
                                                 monday9am.getTime().getTime(),
                                                 monday9am.getTime().getTime() + FIVE_YEARS);
        verifyTranslations(fifteenMinTimeline, monday9am.getTime().getTime());
    }

    /**
     * Tests translations between timelines.
     * 
     * @param timeline the timeline to use for verifications.
     * @param startTest  ??.
     */
    public void verifyTranslations(SegmentedTimeline timeline, long startTest) {
        for (long testCycle = TEST_CYCLE_START; testCycle < TEST_CYCLE_END;
             testCycle += TEST_CYCLE_INC) {

            long millisecond = startTest + testCycle * timeline.getSegmentSize();
            SegmentedTimeline.Segment segment = timeline.getSegment(millisecond);
            
            for (int i = 0; i < 1000; i++) {
                long translatedValue = timeline.toTimelineValue(segment.getMillisecond());
                long newValue = timeline.toMillisecond(translatedValue);

                if (segment.inExcludeSegments() || segment.inExceptionSegments()) {
                    // the reverse transformed value will be in the start of the
                    // next non-excluded and non-exception segment
                    SegmentedTimeline.Segment tempSegment = segment.copy();
                    tempSegment.moveIndexToStart();
                    do {
                        tempSegment.inc();
                    }
                    while (!tempSegment.inIncludeSegments());
                    assertEquals(tempSegment.getMillisecond(), newValue);
                }

                else {
                    assertEquals(segment.getMillisecond(), newValue);
                }
                segment.inc();
            }
        }
    }

    //////////////////////////////////////////////////////////////////////////
    // test serialization
    //////////////////////////////////////////////////////////////////////////

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        verifySerialization(msTimeline);
        verifySerialization(ms2Timeline);
        verifySerialization(ms2BaseTimeline);
        verifySerialization(SegmentedTimeline.newMondayThroughFridayTimeline());
        verifySerialization(SegmentedTimeline.newFifteenMinuteTimeline());
    }

    /**
     * Tests serialization of an instance.
     * @param a1 The timeline to verify the serialization
     */
    private void verifySerialization(SegmentedTimeline a1) {
        SegmentedTimeline a2 = null;

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

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

    /**
     * Adds an array of exceptions to the timeline. The timeline exception list
     * is first cleared.
     * @param timeline The timeline where the exceptions will be stored
     * @param exceptionString The exceptions to load
     * @param fmt The date formatter to use to parse each exceptions[i] value
     * @throws ParseException If there is any exception parsing each exceptions[i]
     *        value.
     * @return An array of Dates[] containing each exception date.
     */
    private long[] verifyFillInExceptions(SegmentedTimeline timeline,
                                         String[] exceptionString,
                                         Format fmt) throws ParseException {
        // make sure there are no exceptions
        timeline.setExceptionSegments(new java.util.ArrayList());
        assertEquals(0, timeline.getExceptionSegments().size());

        // add our exceptions and store locally in ArrayList of Longs
        ArrayList exceptionList = new ArrayList();
        for (int i = 0; i < exceptionString.length; i++) {
            long e;
            if (fmt instanceof NumberFormat) {
                e = ((NumberFormat) fmt).parse(exceptionString[i]).longValue();
            }
            else {
                e = timeline.getTime(((SimpleDateFormat) fmt).parse(exceptionString[i]));
            }
            // only add an exception if it is currently an included segment
            SegmentedTimeline.Segment segment = timeline.getSegment(e);
            if (segment.inIncludeSegments()) {
                timeline.addException(e);
                exceptionList.add(new Long(e));
                assertEquals(exceptionList.size(), timeline.getExceptionSegments().size());
                assertTrue(segment.inExceptionSegments());
            }
        }

        // make array of exceptions
        long[] exception = new long[exceptionList.size()];
        int i = 0;
        for (Iterator iter = exceptionList.iterator(); iter.hasNext();) {
            Long l = (Long) iter.next();
            exception[i++] = l.longValue();
        }

        return (exception);

    }

    /**
     * Adds an array of exceptions relative to the base timeline.
     *
     * @param timeline The timeline where the exceptions will be stored
     * @param exceptionString The exceptions to load
     * @param fmt The date formatter to use to parse each exceptions[i] value
     * @throws ParseException If there is any exception parsing each exceptions[i]
     *        value.
     */
    private void fillInBaseTimelineExceptions(SegmentedTimeline timeline,
                                             String[] exceptionString,
                                             Format fmt) throws ParseException {
        SegmentedTimeline baseTimeline = timeline.getBaseTimeline();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品欧美精品| 亚洲人成在线观看一区二区| 美女免费视频一区| 亚洲色图欧洲色图| 久久精品无码一区二区三区| 91精品国产91热久久久做人人| 久久精工是国产品牌吗| 久久午夜电影网| 欧美日韩高清一区二区不卡| 国产99久久久国产精品免费看| 免费观看在线综合色| 免播放器亚洲一区| 欧美亚洲动漫精品| 精品盗摄一区二区三区| 精品日韩一区二区三区免费视频| 精品久久一区二区三区| 欧美成人猛片aaaaaaa| 久久久影院官网| 国产精品国产三级国产普通话三级| 中文字幕中文字幕中文字幕亚洲无线| 亚洲欧美日韩综合aⅴ视频| 亚洲一级二级在线| 免费欧美高清视频| 国产精品 日产精品 欧美精品| 成人免费av在线| 欧美性感一区二区三区| 日韩欧美中文字幕一区| 久久蜜臀精品av| 一区二区在线观看视频| 天涯成人国产亚洲精品一区av| 精品一区二区三区视频| 波多野结衣在线一区| 欧洲精品在线观看| 精品三级av在线| 综合久久久久综合| 日韩高清在线一区| 色欧美88888久久久久久影院| 91视视频在线观看入口直接观看www| 91精品1区2区| 精品国产乱码久久久久久夜甘婷婷 | 亚洲欧洲精品成人久久奇米网| 亚洲精品日韩一| 麻豆91在线观看| 色综合天天综合在线视频| 欧日韩精品视频| 久久女同互慰一区二区三区| 亚洲色图在线视频| 日韩女优制服丝袜电影| 国产视频一区二区在线观看| 中文在线免费一区三区高中清不卡| 中文字幕av不卡| 狠狠色丁香久久婷婷综合_中 | 色偷偷成人一区二区三区91| 欧美日韩一卡二卡| 亚洲色图欧洲色图| 欧美日韩国产三级| 91亚洲精品乱码久久久久久蜜桃| 国产成人午夜精品5599 | 色婷婷综合久久久久中文一区二区 | 色悠悠久久综合| 日韩精品在线网站| 亚洲中国最大av网站| 国产91综合网| 欧美一级片免费看| 一区二区理论电影在线观看| 激情欧美日韩一区二区| 欧美日韩国产综合一区二区 | 国产精品资源站在线| 欧美熟乱第一页| 国产精品每日更新在线播放网址| 全国精品久久少妇| 欧美色网一区二区| 亚洲欧洲av在线| 国产高清不卡一区| 日韩欧美黄色影院| 婷婷丁香激情综合| 在线观看av不卡| 成人欧美一区二区三区| 韩国女主播一区| 日韩视频在线一区二区| 五月天亚洲婷婷| 在线视频国内一区二区| 中文字幕在线不卡一区二区三区 | 精品视频在线免费观看| 中文字幕日本不卡| 成人短视频下载| 中文字幕乱码久久午夜不卡| 7777精品伊人久久久大香线蕉最新版| 国产精品视频第一区| 懂色av中文字幕一区二区三区| 久久新电视剧免费观看| 国产精品一区二区x88av| 国产日产欧美一区| 99久久国产综合色|国产精品| 亚洲色图清纯唯美| 欧美亚洲国产一区二区三区| 天天影视网天天综合色在线播放| 日韩欧美电影一区| 精品久久人人做人人爽| 日韩一级大片在线| 久久众筹精品私拍模特| 极品美女销魂一区二区三区免费| 7777精品伊人久久久大香线蕉| 亚洲国产成人av网| 欧美丝袜自拍制服另类| 午夜精彩视频在线观看不卡| 欧美日韩三级一区二区| 丁香婷婷综合色啪| 国产亚洲综合在线| av一区二区三区| 国产精品国产成人国产三级| 99久久99久久精品国产片果冻| 亚洲欧美日韩一区二区三区在线观看| 成人在线视频一区| 亚洲色图欧美激情| 欧美视频日韩视频在线观看| 天堂久久一区二区三区| 日韩一区二区免费电影| 国产黑丝在线一区二区三区| 91精品国产手机| 日韩高清不卡在线| 日韩精品一区二区三区三区免费| 精品写真视频在线观看| 国产亚洲欧美一区在线观看| 亚洲男同性视频| 欧洲精品一区二区| 日韩电影网1区2区| 26uuu久久天堂性欧美| 国产成人8x视频一区二区 | 亚洲国产成人av网| 91精品久久久久久久91蜜桃 | 日本精品视频一区二区| 香蕉久久一区二区不卡无毒影院| 欧美一区二区在线不卡| 国产一区二区剧情av在线| 日韩美女视频一区二区| 欧美日韩三级一区二区| 韩国v欧美v亚洲v日本v| 亚洲午夜久久久| 五月激情六月综合| 亚洲成人自拍偷拍| 亚洲v中文字幕| 丝袜国产日韩另类美女| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 成人午夜在线播放| 17c精品麻豆一区二区免费| 日本高清不卡aⅴ免费网站| 日韩国产欧美视频| 国产视频一区二区在线| 欧美三级日韩三级国产三级| 韩国视频一区二区| 亚洲精品中文字幕乱码三区| 日韩欧美美女一区二区三区| 99久久久精品| 麻豆精品一区二区av白丝在线| 国产精品久久久久久久蜜臀| 欧美肥妇bbw| 91在线播放网址| 久久成人免费日本黄色| 亚洲欧美一区二区三区孕妇| 欧美v国产在线一区二区三区| 欧美浪妇xxxx高跟鞋交| 国产美女在线观看一区| 亚洲成人动漫av| 国产精品久久午夜夜伦鲁鲁| 3d动漫精品啪啪一区二区竹菊| 高清视频一区二区| 美日韩一级片在线观看| 亚洲综合网站在线观看| 中文字幕乱码亚洲精品一区| 日韩一级大片在线观看| 色婷婷精品久久二区二区蜜臀av | 99re热这里只有精品视频| 捆绑调教美女网站视频一区| 一区二区三区在线视频观看| 欧美成人在线直播| 欧美日韩美女一区二区| 91在线观看一区二区| 国产伦精一区二区三区| 日韩av成人高清| 亚洲午夜国产一区99re久久| 国产精品乱码一区二三区小蝌蚪| 精品国产乱码久久久久久免费| 欧美日韩成人激情| 91激情在线视频| av福利精品导航| 久久日韩精品一区二区五区| 一二三四社区欧美黄| www.亚洲国产| 亚洲国产精品99久久久久久久久| 日本最新不卡在线| 欧美日韩免费视频| 午夜精品久久久| 欧美日韩国产一级片| 日本亚洲视频在线| 欧洲国产伦久久久久久久| 国产精品福利电影一区二区三区四区| 天天影视色香欲综合网老头| 精品视频999| 裸体在线国模精品偷拍|