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

📄 week.html

📁 jfreechart1。0。2的api。
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<FONT color="green">469</FONT>                            }<a name="line.469"></a><FONT color="green">470</FONT>                            result = new Week(w, y);<a name="line.470"></a><FONT color="green">471</FONT>                        }<a name="line.471"></a><FONT color="green">472</FONT>                        else {<a name="line.472"></a><FONT color="green">473</FONT>                            throw new TimePeriodFormatException(<a name="line.473"></a><FONT color="green">474</FONT>                                "Can't evaluate the year."<a name="line.474"></a><FONT color="green">475</FONT>                            );<a name="line.475"></a><FONT color="green">476</FONT>                        }<a name="line.476"></a><FONT color="green">477</FONT>                    }<a name="line.477"></a><FONT color="green">478</FONT>    <a name="line.478"></a><FONT color="green">479</FONT>                }<a name="line.479"></a><FONT color="green">480</FONT>                else {<a name="line.480"></a><FONT color="green">481</FONT>                    throw new TimePeriodFormatException(<a name="line.481"></a><FONT color="green">482</FONT>                        "Could not find separator."<a name="line.482"></a><FONT color="green">483</FONT>                    );<a name="line.483"></a><FONT color="green">484</FONT>                }<a name="line.484"></a><FONT color="green">485</FONT>    <a name="line.485"></a><FONT color="green">486</FONT>            }<a name="line.486"></a><FONT color="green">487</FONT>            return result;<a name="line.487"></a><FONT color="green">488</FONT>    <a name="line.488"></a><FONT color="green">489</FONT>        }<a name="line.489"></a><FONT color="green">490</FONT>    <a name="line.490"></a><FONT color="green">491</FONT>        /**<a name="line.491"></a><FONT color="green">492</FONT>         * Finds the first occurrence of ' ', '-', ',' or '.'<a name="line.492"></a><FONT color="green">493</FONT>         *<a name="line.493"></a><FONT color="green">494</FONT>         * @param s  the string to parse.<a name="line.494"></a><FONT color="green">495</FONT>         *<a name="line.495"></a><FONT color="green">496</FONT>         * @return &lt;code&gt;-1&lt;/code&gt; if none of the characters was found, the<a name="line.496"></a><FONT color="green">497</FONT>         *      index of the first occurrence otherwise.<a name="line.497"></a><FONT color="green">498</FONT>         */<a name="line.498"></a><FONT color="green">499</FONT>        private static int findSeparator(String s) {<a name="line.499"></a><FONT color="green">500</FONT>    <a name="line.500"></a><FONT color="green">501</FONT>            int result = s.indexOf('-');<a name="line.501"></a><FONT color="green">502</FONT>            if (result == -1) {<a name="line.502"></a><FONT color="green">503</FONT>                result = s.indexOf(',');<a name="line.503"></a><FONT color="green">504</FONT>            }<a name="line.504"></a><FONT color="green">505</FONT>            if (result == -1) {<a name="line.505"></a><FONT color="green">506</FONT>                result = s.indexOf(' ');<a name="line.506"></a><FONT color="green">507</FONT>            }<a name="line.507"></a><FONT color="green">508</FONT>            if (result == -1) {<a name="line.508"></a><FONT color="green">509</FONT>                result = s.indexOf('.');<a name="line.509"></a><FONT color="green">510</FONT>            }<a name="line.510"></a><FONT color="green">511</FONT>            return result;<a name="line.511"></a><FONT color="green">512</FONT>        }<a name="line.512"></a><FONT color="green">513</FONT>    <a name="line.513"></a><FONT color="green">514</FONT>        /**<a name="line.514"></a><FONT color="green">515</FONT>         * Creates a year from a string, or returns null (format exceptions<a name="line.515"></a><FONT color="green">516</FONT>         * suppressed).<a name="line.516"></a><FONT color="green">517</FONT>         *<a name="line.517"></a><FONT color="green">518</FONT>         * @param s  string to parse.<a name="line.518"></a><FONT color="green">519</FONT>         *<a name="line.519"></a><FONT color="green">520</FONT>         * @return &lt;code&gt;null&lt;/code&gt; if the string is not parseable, the year <a name="line.520"></a><FONT color="green">521</FONT>         *         otherwise.<a name="line.521"></a><FONT color="green">522</FONT>         */<a name="line.522"></a><FONT color="green">523</FONT>        private static Year evaluateAsYear(String s) {<a name="line.523"></a><FONT color="green">524</FONT>    <a name="line.524"></a><FONT color="green">525</FONT>            Year result = null;<a name="line.525"></a><FONT color="green">526</FONT>            try {<a name="line.526"></a><FONT color="green">527</FONT>                result = Year.parseYear(s);<a name="line.527"></a><FONT color="green">528</FONT>            }<a name="line.528"></a><FONT color="green">529</FONT>            catch (TimePeriodFormatException e) {<a name="line.529"></a><FONT color="green">530</FONT>                // suppress<a name="line.530"></a><FONT color="green">531</FONT>            }<a name="line.531"></a><FONT color="green">532</FONT>            return result;<a name="line.532"></a><FONT color="green">533</FONT>    <a name="line.533"></a><FONT color="green">534</FONT>        }<a name="line.534"></a><FONT color="green">535</FONT>    <a name="line.535"></a><FONT color="green">536</FONT>        /**<a name="line.536"></a><FONT color="green">537</FONT>         * Converts a string to a week.<a name="line.537"></a><FONT color="green">538</FONT>         *<a name="line.538"></a><FONT color="green">539</FONT>         * @param s  the string to parse.<a name="line.539"></a><FONT color="green">540</FONT>         * @return &lt;code&gt;-1&lt;/code&gt; if the string does not contain a week number,<a name="line.540"></a><FONT color="green">541</FONT>         *         the number of the week otherwise.<a name="line.541"></a><FONT color="green">542</FONT>         */<a name="line.542"></a><FONT color="green">543</FONT>        private static int stringToWeek(String s) {<a name="line.543"></a><FONT color="green">544</FONT>    <a name="line.544"></a><FONT color="green">545</FONT>            int result = -1;<a name="line.545"></a><FONT color="green">546</FONT>            s = s.replace('W', ' ');<a name="line.546"></a><FONT color="green">547</FONT>            s = s.trim();<a name="line.547"></a><FONT color="green">548</FONT>            try {<a name="line.548"></a><FONT color="green">549</FONT>                result = Integer.parseInt(s);<a name="line.549"></a><FONT color="green">550</FONT>                if ((result &lt; 1) || (result &gt; LAST_WEEK_IN_YEAR)) {<a name="line.550"></a><FONT color="green">551</FONT>                    result = -1;<a name="line.551"></a><FONT color="green">552</FONT>                }<a name="line.552"></a><FONT color="green">553</FONT>            }<a name="line.553"></a><FONT color="green">554</FONT>            catch (NumberFormatException e) {<a name="line.554"></a><FONT color="green">555</FONT>                // suppress<a name="line.555"></a><FONT color="green">556</FONT>            }<a name="line.556"></a><FONT color="green">557</FONT>            return result;<a name="line.557"></a><FONT color="green">558</FONT>    <a name="line.558"></a><FONT color="green">559</FONT>        }<a name="line.559"></a><FONT color="green">560</FONT>        <a name="line.560"></a><FONT color="green">561</FONT>    }<a name="line.561"></a></PRE></BODY></HTML>

⌨️ 快捷键说明

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