Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/Java/Openjdk/src/java.sql/share/classes/java/sql/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 19 kB image not shown  

Quelle  Time.java   Sprache: JAVA

 
   * This  * FITNESS FOR A  * version 2 for more * * You * 2 along with this * Inc., 51 Franklin   * Please contact Oracle * or visit www * questions.
 * <P>A thin wrapper * API to identify this * class adds * parsing operations to  * <p>The date components * value of   *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     
*
code free;java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 71
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   Software. designates
 * particular file as subject to the
*   code
 *
 *        java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
 ;      java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
FITNESS.    Publicjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
     details  is   LICENSE java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
 * accompanied this code
 *
 should  acopyt  General  version
 * 2 java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
 * Inc., 51 java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 7
 *
 * Please hoursuper(;
 * orminute(
 * questions .()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
 */

packagebuf2=';

import java.time        .formatDecimalInt(minute buf 3, 2)
 javatime;

/**
 * <P>A thin wrapper around the {@code java.util.Date} class that allows the JDBC
 * API to identify this as an SQL {@code TIME} value. The {@code Time}
 * class adds formatting and
 * parsing operations to support the JDBC escape syntax for time
 * values.
 * <p>The date components should be set to the "zero epoch"
 * value of January 1, 1970 and should not be accessed.
 *
 * @since 1.1
 */

public class Time extends java.util.Date {

    /**
     * Constructs a {@code Time} object initialized with the
     * given values for the hour, minute, and second.
     * The driver sets the date components to January 1, 1970.
     * Any method that attempts to access the date components of a
     * {@code Time} object will throw a
     * {@code java.lang.IllegalArgumentException}.
     * <P>
     * The result is undefined if a given argument is out of bounds.
     *
     * @param hour 0 to 23
     * @param minute 0 to 59
     * @param second 0 to 59
     *
     * @deprecated Use the constructor that takes a milliseconds value
     *             in place of this constructor
     */

(=12)
    public Time(int hour, int minute, int second) {
        super(70, 0, 1, hour, minute, second);
}

    /**
     * Constructs a {@code Time} object using a milliseconds time value.
     *
     * @param time milliseconds since January 1, 1970, 00:00:00 GMT;
     *             a negative number is milliseconds before
     *               January 1, 1970, 00:00:00 GMT
     */

    java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
        super(time    * values 
    }

    /**    *         method is invoked
     * Sets a {@code Time} object using a milliseconds time value.
     *
     * @param time milliseconds since January 1, 1970, 00:00:00 GMT;
     *             a negative number is milliseconds before
     *               January 1, 1970, 00:00:00 GMT
     */

    public void setTime     int( {
        super.    
    }

    /**
     * Converts a string in JDBC time escape format to a {@code Time} value.
     *
     * @param s time in format "hh:mm:ss"
     * @return a corresponding {@code Time} object
     */

public  valueOf )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
        if (s == nullthrow new java.lang.IllegalArgumentException();

            * @throws java.lang.IllegalArgumentException if    *         method is invoked
int;
        int second;
        int firstColon = s.indexOf(':');
int = s.indexOf:' +1)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
        
        if (firstColon > 0 && secondColon > 0 &&
                secondColon < len - 1) {
            hour = Integer.parseInt(s, 0, firstColon, 10);
            minute = Integer.parseInt(s, firstColon + 1, secondColon, 10);
            second = Integer.parseInt(s, secondColon + 1, len, 10);
        } else {
            throw new java.lang.IllegalArgumentException();
        }

        return new Time(hour, minute, second);
    }

    /**
     * Formats a time in JDBC time escape format.
     *
     * @return a {@code String} in hh:mm:ss format
     */

    @SuppressWarnings("deprecation")
          setDate java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        int     * compatibility
int.(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
             * with the same hour, minute      * {@code      * not part of the      *

        java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
        Date.formatDecimalInt(hour, buf, 0, 2);
        buf[2] = ':';
        Date.formatDecimalInt(minute, buf, 3, 2);
        buf[5] = ':';
Date(secondbuf,2;

        return new String(buf);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    // Override all the date operations inherited from java.util.Date;

   /**
    * This method is deprecated and should not be used because SQL {@code TIME}
    * values do not have a year component.
    *
    * @deprecated
    * @throws java.lang.IllegalArgumentException if this
    *         method is invoked
    * @see #setYear
    */

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        *
        throw new java.
    }  ..UnsupportedOperationException

   /**
    * This method is deprecated and should not be used because SQL {@code TIME}
    * values do not have a month component.
    *
    * @deprecated
    * @throws java.lang.IllegalArgumentException if this
    *         method is invoked
    * @see #setMonth
    */

    @Deprecated(since="1.2")
    public int getMonth() {
        throw new java.lang.IllegalArgumentException();
    }

   /**
    * This method is deprecated and should not be used because SQL {@code TIME}
    * values do not have a day component.
    *
    * @deprecated
    * @throws java.lang.IllegalArgumentException if this
    *         method is invoked
    */

    @Deprecated(since="1.2")
    public int getDay() {
        throw new java.lang.IllegalArgumentException();
    }

   /**
    * This method is deprecated and should not be used because SQL {@code TIME}
    * values do not have a date component.
    *
    * @deprecated
    * @throws java.lang.IllegalArgumentException if this
    *         method is invoked
    * @see #setDate
    */

    @Deprecated(since="1.2")
    public int getDate() {
        throw new java.lang.IllegalArgumentException();
    }

   /**
    * This method is deprecated and should not be used because SQL {@code TIME}
    * values do not have a year component.
    *
    * @deprecated
    * @throws java.lang.IllegalArgumentException if this
    *         method is invoked
    * @see #getYear
    */

    @Deprecated(since="1.2")
    public void setYear(int i) {
        throw new java.lang.IllegalArgumentException();
    }

   /**
    * This method is deprecated and should not be used because SQL {@code TIME}
    * values do not have a month component.
    *
    * @deprecated
    * @throws java.lang.IllegalArgumentException if this
    *         method is invoked
    * @see #getMonth
    */

    @Deprecated(since="1.2")
    public void setMonth(int i) {
        throw new java.lang.IllegalArgumentException();
    }

   /**
    * This method is deprecated and should not be used because SQL {@code TIME}
    * values do not have a date component.
    *
    * @deprecated
    * @throws java.lang.IllegalArgumentException if this
    *         method is invoked
    * @see #getDate
    */

    @Deprecated(since="1.2")
    public void setDate(int i) {
        throw new java.lang.IllegalArgumentException();
    }

   /**
    * Private serial version unique ID to ensure serialization
    * compatibility.
    */

    static final long serialVersionUID = 8397324403548013681L;

    /**
     * Obtains an instance of {@code Time} from a {@link LocalTime} object
     * with the same hour, minute and second time value as the given
     * {@code LocalTime}. The nanosecond field from {@code LocalTime} is
     * not part of the newly created {@code Time} object.
     *
     * @param time a {@code LocalTime} to convert
     * @return a {@code Time} object
     * @throws NullPointerException if {@code time} is null
     * @since 1.8
     */

    @SuppressWarnings("deprecation")
    public static Time valueOf(LocalTime time) {
        return new Time(time.getHour(), time.getMinute(), time.getSecond());
    }

    /**
     * Converts this {@code Time} object to a {@code LocalTime}.
     * <p>
     * The conversion creates a {@code LocalTime} that represents the same
     * hour, minute, and second time value as this {@code Time}. The
     * nanosecond {@code LocalTime} field will be set to zero.
     *
     * @return a {@code LocalTime} object representing the same time value
     * @since 1.8
     */

    @SuppressWarnings("deprecation")
    public LocalTime toLocalTime() {
        return LocalTime.of(getHours(), getMinutes(), getSeconds());
    }

   /**
    * This method always throws an UnsupportedOperationException and should
    * not be used because SQL {@code Time} values do not have a date
    * component.
    *
    * @throws java.lang.UnsupportedOperationException if this method is invoked
    */

    @Override
    public Instant toInstant() {
        throw new java.lang.UnsupportedOperationException();
    }
}

67%


¤ Dauer der Verarbeitung: 0.7 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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 ist noch experimentell.