All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.icu.impl.duration.PeriodBuilder Maven / Gradle / Ivy

Go to download

International Component for Unicode for Java (ICU4J) is a mature, widely used Java library providing Unicode and Globalization support

There is a newer version: 76.1
Show newest version
/*
******************************************************************************
* Copyright (C) 2007, International Business Machines Corporation and   *
* others. All Rights Reserved.                                               *
******************************************************************************
*/

package com.ibm.icu.impl.duration;

import java.util.TimeZone;

/**
 * Constructs a Period given a base time and a duration in milliseconds.
 * 

* PeriodBuilder may be used alone or be set on a DurationFormatter * to customize how that formatter constructs a Period for formatting. *

* None of the operations on PeriodBuilder change the current builder. */ public interface PeriodBuilder { /** * Create a period of the given duration using the current system * time as the reference time. * * @param duration the duration in milliseconds from the current time * to the target time. A negative duration indicates a time in the past * @return a Period that represents the duration */ Period create(long duration); /** * Create a period of the given duration using the provided reference date. * * @param duration the duration in milliseconds from the referenct time * to the target time. A negative duration indicates a time before the * reference time * @param referenceDate the reference date from which to compute the period * @return a Period that represents the duration */ Period createWithReferenceDate(long duration, long referenceDate); /** * Returns a new PeriodBuilder that uses the provided locale to * determine what periods are available for use. */ PeriodBuilder withLocale(String localeName); /** * Returns a new PeriodBuilder that computes periods starting at * dates in the provided time zone. */ PeriodBuilder withTimeZone(TimeZone tz); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy