BaseDuration
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.joda.time.base.BaseDuration(Showing top 15 results out of 315)

origin: joda-time/joda-time

/**
 * Converts this duration to a Period instance using the specified period type
 * and the ISO chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * At most these are hours, minutes, seconds and millis - the period
 * type may restrict the selection further.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant, PeriodType)}.
 * 
 * @param type  the period type to use, null means standard
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(PeriodType type) {
  return new Period(getMillis(), type);
}
origin: joda-time/joda-time

/**
 * Converts this duration to a Period instance using the standard period type
 * and the specified chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * Exactly which fields are precise depends on the chronology.
 * Only the time fields are precise for ISO chronology with a time zone.
 * However, ISO UTC also has precise days and weeks.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant)} and
 * {@link #toPeriodTo(ReadableInstant)}
 * 
 * @param chrono  the chronology to use, null means ISO default
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(Chronology chrono) {
  return new Period(getMillis(), chrono);
}
origin: joda-time/joda-time

/**
 * Converts this duration to a Period instance using the specified period type
 * and chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * Exactly which fields are precise depends on the chronology.
 * Only the time fields are precise for ISO chronology with a time zone.
 * However, ISO UTC also has precise days and weeks.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant, PeriodType)} and
 * {@link #toPeriodTo(ReadableInstant, PeriodType)}
 * 
 * @param type  the period type to use, null means standard
 * @param chrono  the chronology to use, null means ISO default
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(PeriodType type, Chronology chrono) {
  return new Period(getMillis(), type, chrono);
}
origin: JodaOrg/joda-time

/**
 * Converts this duration to a Period instance using the specified period type
 * and the ISO chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * At most these are hours, minutes, seconds and millis - the period
 * type may restrict the selection further.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant, PeriodType)}.
 * 
 * @param type  the period type to use, null means standard
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(PeriodType type) {
  return new Period(getMillis(), type);
}
origin: JodaOrg/joda-time

/**
 * Converts this duration to a Period instance using the standard period type
 * and the specified chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * Exactly which fields are precise depends on the chronology.
 * Only the time fields are precise for ISO chronology with a time zone.
 * However, ISO UTC also has precise days and weeks.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant)} and
 * {@link #toPeriodTo(ReadableInstant)}
 * 
 * @param chrono  the chronology to use, null means ISO default
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(Chronology chrono) {
  return new Period(getMillis(), chrono);
}
origin: JodaOrg/joda-time

/**
 * Converts this duration to a Period instance using the specified period type
 * and chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * Exactly which fields are precise depends on the chronology.
 * Only the time fields are precise for ISO chronology with a time zone.
 * However, ISO UTC also has precise days and weeks.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant, PeriodType)} and
 * {@link #toPeriodTo(ReadableInstant, PeriodType)}
 * 
 * @param type  the period type to use, null means standard
 * @param chrono  the chronology to use, null means ISO default
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(PeriodType type, Chronology chrono) {
  return new Period(getMillis(), type, chrono);
}
origin: intuit/wasabi

/**
 * Converts this duration to a Period instance using the specified period type
 * and the ISO chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * At most these are hours, minutes, seconds and millis - the period
 * type may restrict the selection further.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant, PeriodType)}.
 * 
 * @param type  the period type to use, null means standard
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(PeriodType type) {
  return new Period(getMillis(), type);
}
origin: Nextdoor/bender

/**
 * Converts this duration to a Period instance using the specified period type
 * and the ISO chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * At most these are hours, minutes, seconds and millis - the period
 * type may restrict the selection further.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant, PeriodType)}.
 * 
 * @param type  the period type to use, null means standard
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(PeriodType type) {
  return new Period(getMillis(), type);
}
origin: Nextdoor/bender

/**
 * Converts this duration to a Period instance using the specified period type
 * and the ISO chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * At most these are hours, minutes, seconds and millis - the period
 * type may restrict the selection further.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant, PeriodType)}.
 * 
 * @param type  the period type to use, null means standard
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(PeriodType type) {
  return new Period(getMillis(), type);
}
origin: hstaudacher/osgi-jax-rs-connector

/**
 * Converts this duration to a Period instance using the specified period type
 * and the ISO chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * At most these are hours, minutes, seconds and millis - the period
 * type may restrict the selection further.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant, PeriodType)}.
 * 
 * @param type  the period type to use, null means standard
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(PeriodType type) {
  return new Period(getMillis(), type);
}
origin: pingcap/tispark

/**
 * Converts this duration to a Period instance using the specified period type
 * and the ISO chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * At most these are hours, minutes, seconds and millis - the period
 * type may restrict the selection further.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant, PeriodType)}.
 * 
 * @param type  the period type to use, null means standard
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(PeriodType type) {
  return new Period(getMillis(), type);
}
origin: intuit/wasabi

/**
 * Converts this duration to a Period instance using the standard period type
 * and the specified chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * Exactly which fields are precise depends on the chronology.
 * Only the time fields are precise for ISO chronology with a time zone.
 * However, ISO UTC also has precise days and weeks.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant)} and
 * {@link #toPeriodTo(ReadableInstant)}
 * 
 * @param chrono  the chronology to use, null means ISO default
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(Chronology chrono) {
  return new Period(getMillis(), chrono);
}
origin: Nextdoor/bender

/**
 * Converts this duration to a Period instance using the standard period type
 * and the specified chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * Exactly which fields are precise depends on the chronology.
 * Only the time fields are precise for ISO chronology with a time zone.
 * However, ISO UTC also has precise days and weeks.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant)} and
 * {@link #toPeriodTo(ReadableInstant)}
 * 
 * @param chrono  the chronology to use, null means ISO default
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(Chronology chrono) {
  return new Period(getMillis(), chrono);
}
origin: hstaudacher/osgi-jax-rs-connector

/**
 * Converts this duration to a Period instance using the standard period type
 * and the specified chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * Exactly which fields are precise depends on the chronology.
 * Only the time fields are precise for ISO chronology with a time zone.
 * However, ISO UTC also has precise days and weeks.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant)} and
 * {@link #toPeriodTo(ReadableInstant)}
 * 
 * @param chrono  the chronology to use, null means ISO default
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(Chronology chrono) {
  return new Period(getMillis(), chrono);
}
origin: pingcap/tispark

/**
 * Converts this duration to a Period instance using the standard period type
 * and the specified chronology.
 * <p>
 * Only precise fields in the period type will be used.
 * Exactly which fields are precise depends on the chronology.
 * Only the time fields are precise for ISO chronology with a time zone.
 * However, ISO UTC also has precise days and weeks.
 * <p>
 * For more control over the conversion process, you must pair the duration with
 * an instant, see {@link #toPeriodFrom(ReadableInstant)} and
 * {@link #toPeriodTo(ReadableInstant)}
 * 
 * @param chrono  the chronology to use, null means ISO default
 * @return a Period created using the millisecond duration from this instance
 */
public Period toPeriod(Chronology chrono) {
  return new Period(getMillis(), chrono);
}
org.joda.time.baseBaseDuration

Javadoc

BaseDuration is an abstract implementation of ReadableDuration that stores data in a long duration milliseconds field.

This class should generally not be used directly by API users. The ReadableDuration interface should be used when different kinds of duration objects are to be referenced.

BaseDuration subclasses may be mutable and not thread-safe.

Most used methods

  • getMillis
    Gets the length of this duration in milliseconds.

Popular classes and methods

  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • URL (java.net)
    Class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • JPanel (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)