net.time4j.DayCycles Maven / Gradle / Ivy
/*
* -----------------------------------------------------------------------
* Copyright © 2013-2015 Meno Hochschild,
* -----------------------------------------------------------------------
* This file (DayCycles.java) is part of project Time4J.
*
* Time4J 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.
*
* Time4J 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 Time4J. If not, see .
* -----------------------------------------------------------------------
*/
package net.time4j;
import java.io.Serializable;
/**
* Represents the rolling result of a plain time if a possible day overflow
* is to be taken into account.
*
* @author Meno Hochschild
* @doctags.concurrency {immutable}
* @see PlainTime#roll(long,ClockUnit)
*/
/*[deutsch]
* Verkörpert das Rollergebnis auf einer Uhrzeit, wenn auch ein
* tageweiser Überlauf gezählt werden soll.
*
* @author Meno Hochschild
* @doctags.concurrency {immutable}
* @see PlainTime#roll(long,ClockUnit)
*/
public final class DayCycles implements Serializable {
//~ Statische Felder/Initialisierungen --------------------------------
private static final long serialVersionUID = -4124961309622141228L;
//~ Instanzvariablen --------------------------------------------------
/**
* @serial day overflow
*/
/*[deutsch]
* @serial Überlauf in Tagen
*/
private final long days;
/**
* @serial wall time
*/
/*[deutsch]
* @serial Uhrzeit
*/
private final PlainTime time;
//~ Konstruktoren -----------------------------------------------------
/**
* Konstruiert eine neue Instanz mit Überlauf und Uhrzeit.
*
* @param days day overflow
* @param time wall time result of last calculation
*/
DayCycles(long days, PlainTime time) {
super();
this.days = days;
this.time = time;
}
//~ Methoden ----------------------------------------------------------
/**
* Gets the day overflow after rolling a plain time.
*
* @return count of day cycles ({@code 0} if without overflow)
*/
/*[deutsch]
* Ermittelt den tageweise Überlauf im Additionsergebnis.
*
* @return count of day cycles ({@code 0} if without overflow)
*/
public long getDayOverflow() {
return this.days;
}
/**
* Gets the rolled wall time.
*
* @return wall time (never 24:00)
*/
/*[deutsch]
* Ermittelt die Uhrzeit.
*
* @return wall time (never 24:00)
*/
public PlainTime getWallTime() {
return this.time;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy