io.deephaven.engine.table.impl.sources.ConvertibleTimeSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-engine-table Show documentation
Show all versions of deephaven-engine-table Show documentation
Engine Table: Implementation and closely-coupled utilities
/**
* Copyright (c) 2016-2023 Deephaven Data Labs and Patent Pending
*/
package io.deephaven.engine.table.impl.sources;
import io.deephaven.engine.table.ColumnSource;
import java.time.*;
/**
* An interface for {@link ColumnSource}s that indicate that it both represents a time value, and may be converted
* between other common time values efficiently.
*/
public interface ConvertibleTimeSource {
/**
* Convert this source to a {@link ZonedDateTime} source at the specified {@link ZoneId zone}.
*
* @param zone the time zone
* @return a view of this source as a {@link ZonedDateTime}
*/
ColumnSource toZonedDateTime(ZoneId zone);
/**
* Convert this source to a {@link LocalDate} source at the specified {@link ZoneId zone}.
*
* @param zone the time zone
* @return a view of this source as a {@link LocalDate}
*/
ColumnSource toLocalDate(ZoneId zone);
/**
* Convert this source to a {@link LocalTime} source at the specified {@link ZoneId zone}.
*
* @param zone the time zone
* @return a view of this source as a {@link LocalTime}
*/
ColumnSource toLocalTime(ZoneId zone);
/**
* Convert this source to an {@link Instant} source.
*
* @return a view of this source asan {@link Instant}
*/
ColumnSource toInstant();
/**
* Convert this source to a {@code long} source of nanoseconds of epoch.
*
* @return a view of this source as a {@link ZonedDateTime}
*/
ColumnSource toEpochNano();
/**
* Check if this class supports time conversion. If false, all other methods will fail.
*
* @return true if time conversion is supported.
*/
boolean supportsTimeConversion();
interface Zoned {
ZoneId getZone();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy