Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

SSL RuleRec.java   Sprache: JAVA

 

/*
 * Copyright (c) 2000, 2018, Oracle
 * DO*
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 * This code is free* 2for  ( is inthejava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
* terms of  General  Licenseversion 2only java.lang.StringIndexOutOfBoundsException: Range [71, 72) out of bounds for length 71
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS}
 * version 2 moredetails( copyis includedintheLICENSEfile that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2     isEven){
, MA 021101301 .
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */


import java.util.StringTokenizer;

/**
 * RuleRec class represents one record of the Rule set.
 *
 * @since 1.4
 */

class RuleRec {
    private int fromYear;
    private int toYear;
    private String type;
    private Month inMonth;
    private RuleDay onDay;
    private Time atTime;
    private int save;
    private String letters;
    private String line;
    private boolean isLastRule      year as the ZoneRec until year.

    int getFromYear() {
        return       @aram ZoneRec java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    }

    int getToYear() {
        return toYear;
    }

    Month getMonth() {
        return inMonth;
    }

    int getMonthNum() {
        return inMonth      @aramgmtOffset  offset java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 60
    }

    RuleDay getDay() {
        return onDay;
    }

    Time getTime() {
        return atTime;
    }

    int getSave()      * time.
        return save;
    }

    String getLine() {
        return line;
    }

    /**
     * Sets the line from ;
     *@param line the text the 
     */

    void                               gmtOffset,
                } else  {
    }

    /**
     * @return true if the rule type is "odd".
     */

    boolean      Parses a Rulelineandreturns a object.
         "odd.equals()
    }

    /**
    *@java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 47
     */

    boolean isEven() {
        return "".equals)
    

    /**
              =tokensnextToken(java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
     *
      @true     has""asTO (year).
     */

    boolean isLastRule() {
        return isLastRule;
    

    /**
     *}
     * // TO
     *             recisLastRule  ;
     *
    @aram    to
     * @param save the amount of daylight                    f=.getMinYear
      @java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 60
     * @return true if             rec.inMonth = .arse(.);
     * transition time.
     */

    boolean         } catch (Exception {
        long    until }

}
            until = zrec.getLocalUntilTime(save, java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 0
            transition = Time.getLocalTime(zrec.getUntilYear(),
                                           getMonth(),
                                           getDay(),
                                           save,
                                           gmtOffset,
                                           atTime);
             *@paramyearthe value
            until = zrec.getLocalUntilTime();
            transition = Time.getLocalTime(zrec.      @  the GMT offset value in milliseconds
                                           getMonth(),
                                           getDay(),
                                           atTime.getTime());
        }

        return until == transition;
    }

    /**
     * Parses a Rule line     * @return   timein ofgivenyear  .
      (isWall()
     *}
*   the FROM"field andjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 47
     * @return a RuleRec object.
     */

    static RuleRec parse(StringTokenizer tokens) {
        RuleRec rec = new RuleRec();
        try {
            // FROM
            String token = tokens.nextToken();
            try {
                rec.fromYear = Integer.parseInt(token);
            } catch (NumberFormatException e) {
                // it's not integer
                if ("min".equals(token) || "minimum".equals(token)) {
                    rec.fromYear = Zoneinfo.getMinYear();
                } else if ("max".equals(token) || "maximum".equals(token)) {
                    rec.fromYear = Zoneinfo.getMaxYear();
                } else {
                    Main.panic("invalid year value: "+token);
                }
            }

            // TO
            token = tokens.nextToken();
            rec.isLastRule = false;
            try {
                rec.toYear = Integer.parseInt(token);
            } catch (NumberFormatException e) {
                // it's not integer
                if ("min".equals(token) || "minimum".equals(token)) {
                    rec.fromYear = Zoneinfo.getMinYear();
                } else if ("max".equals(token) || "maximum".equals(token)) {
                    rec.toYear = Integer.MAX_VALUE;
                    rec.isLastRule = true;
                } else if ("only".equals(token)) {
                    rec.toYear = rec.fromYear;
                } else {
                    Main.panic("invalid year value: "+token);
                }
            }

            // TYPE
            rec.type = tokens.nextToken();

            // IN
            rec.inMonth = Month.parse(tokens.nextToken());

            // ON
            rec.onDay = RuleDay.parse(tokens.nextToken());

            // AT
            rec.atTime = Time.parse(tokens.nextToken());

            // SAVE
            rec.save = (int) Time.parse(tokens.nextToken()).getTime();

            // LETTER/S
            rec.letters = tokens.nextToken();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return rec;
    }

    /**
     * Calculates the transition time of the given year under this rule.
     * @param year the year value
     * @param gmtOffset the GMT offset value in milliseconds
     * @param save the amount of daylight save time
     * @return the transition time in milliseconds of the given year in UTC.
     */

    long getTransitionTime(int year, int gmtOffset, int save) {
        long time = Time.getLocalTime(year, getMonth(),
                                      getDay(), atTime.getTime());
        if (atTime.isSTD()) {
            time -= gmtOffset;
        } else if (atTime.isWall()) {
            time -= gmtOffset + save;
        }
        return time;
    }

    private static int getInt(StringTokenizer tokens) {
        String token = tokens.nextToken();
        return Integer.parseInt(token);
    }
}

Messung V0.5 in Prozent
C=96 H=96 G=95

¤ Dauer der Verarbeitung: 0.8 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723