![JAR search and dependency download from the Maven repository](/logo.png)
fr.vsct.tock.nlp.entity.date.DateEntityRange.kt Maven / Gradle / Ivy
/*
* Copyright (C) 2017 VSCT
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fr.vsct.tock.nlp.entity.date
import fr.vsct.tock.nlp.entity.Value
import java.time.Duration
import java.time.ZoneId
import java.time.ZonedDateTime
/**
* Both [DateEntityValue] && [DateIntervalEntityValue] can be seen as date range.
*/
interface DateEntityRange : Value {
/**
* Returns the start inclusive date.
* Ie
* - 9h -> 9h
* - from 9h to 10h -> 9h
*/
fun start(): ZonedDateTime
/**
* Returns the end inclusive date.
* - from 9h to 10h -> 10h
* - from 9h to 10h00 -> 10h
* - 9h -> 10h
*/
fun inclusiveEnd(): ZonedDateTime = inclusiveEnd(ZoneId.systemDefault())
/**
* Returns the end inclusive date.
* Ie:
* - from 9h to 10h -> 10h
* - from 9h to 10h00 -> 10h
* - 9h -> 10h
*/
fun inclusiveEnd(zoneId: ZoneId): ZonedDateTime = end(zoneId)
/**
* Returns the end exclusive date.
* - from 9h to 10h -> 11h
* - from 9h to 10h00 -> 10h01
* - 9h -> 10h
*/
fun end(): ZonedDateTime = end(ZoneId.systemDefault())
/**
* Returns the end exclusive date.
* Ie:
* - from 9h to 10h -> 11h
* - from 9h to 10h00 -> 10h01
* - 9h -> 10h
*/
fun end(zoneId: ZoneId): ZonedDateTime
fun duration(): Duration
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy