Packages

  • package root
    Definition Classes
    root
  • package java
    Definition Classes
    root
  • package time

    The main API for dates, times, instants, and durations.

    The main API for dates, times, instants, and durations.

    The classes defined here represent the principal date-time concepts, including instants, durations, dates, times, time-zones and periods. They are based on the ISO calendar system, which is the de facto world calendar following the proleptic Gregorian rules. All the classes are immutable and thread-safe.

    Each date time instance is composed of fields that are conveniently made available by the APIs. For lower level access to the fields refer to the org.threeten.bp.temporal package. Each class includes support for printing and parsing all manner of dates and times. Refer to the org.threeten.bp.format package for customization options.

    The org.threeten.bp.chrono package contains the calendar neutral API. This is intended for use by applications that need to use localized calendars. It is recommended that applications use the ISO-8601 dates and time classes from this package across system boundaries, such as to the database or across the network. The calendar neutral API should be reserved for interactions with users.

    Dates and Times

    org.threeten.bp.Instant is essentially a numeric timestamp. The current Instant can be retrieved from a org.threeten.bp.Clock. This is useful for logging and persistence of a point in time and has in the past been associated with storing the result from java.lang.System#currentTimeMillis().

    org.threeten.bp.LocalDate stores a date without a time. This stores a date like '2010-12-03' and could be used to store a birthday.

    org.threeten.bp.LocalTime stores a time without a date. This stores a time like '11:30' and could be used to store an opening or closing time.

    org.threeten.bp.LocalDateTime stores a date and time. This stores a date-time like '2010-12-03T11:30'.

    org.threeten.bp.OffsetTime stores a time and offset from UTC without a date. This stores a date like '11:30+01:00'. The ZoneOffset is of the form '+01:00'.

    org.threeten.bp.OffsetDateTime stores a date and time and offset from UTC. This stores a date-time like '2010-12-03T11:30+01:00'. This is sometimes found in XML messages and other forms of persistence, but contains less information than a full time-zone.

    org.threeten.bp.ZonedDateTime stores a date and time with a time-zone. This is useful if you want to perform accurate calculations of dates and times taking into account the org.threeten.bp.ZoneId, such as 'Europe/Paris'. Where possible, it is recommended to use a simpler class. The widespread use of time-zones tends to add considerable complexity to an application.

    Duration and Period

    Beyond dates and times, the API also allows the storage of period and durations of time. A org.threeten.bp.Duration is a simple measure of time along the time-line in nanoseconds. A org.threeten.bp.Period expresses an amount of time in units meaningful to humans, such as years or hours.

    Additional value types

    org.threeten.bp.Year stores a year on its own. This stores a single year in isolation, such as '2010'.

    org.threeten.bp.YearMonth stores a year and month without a day or time. This stores a year and month, such as '2010-12' and could be used for a credit card expiry.

    org.threeten.bp.MonthDay stores a month and day without a year or time. This stores a month and day-of-month, such as '--12-03' and could be used to store an annual event like a birthday without storing the year.

    org.threeten.bp.Month stores a month on its own. This stores a single month-of-year in isolation, such as 'DECEMBER'.

    org.threeten.bp.DayOfWeek stores a day-of-week on its own. This stores a single day-of-week in isolation, such as 'TUESDAY'.

    Definition Classes
    java
  • package format

    Provides classes to print and parse dates and times.

    Provides classes to print and parse dates and times.

    Printing and parsing is based around the DateTimeFormatter class. That class contains common formatters and factory methods. The DateTimeFormatterBuilder class is available for advanced and complex use cases.

    Localization occurs by calling withLocale(Locale) on the formatter. Further customization is possible using DecimalStyle.

    Definition Classes
    time
  • package internal
    Definition Classes
    format
  • TTBPDateTimeFormatterBuilder
  • TTBPDateTimeParseContext
  • TTBPDateTimePrintContext
  • TTBPDateTimeTextProvider
  • TTBPSimpleDateTimeTextProvider

final class TTBPDateTimeParseContext extends AnyRef

Context object used during date and time parsing.

This class represents the current state of the parse. It has the ability to store and retrieve the parsed values and manage optional segments. It also provides key information to the parsing methods.

Once parsing is complete, the #toBuilder() is typically used to obtain a builder that can combine the separate parsed fields into meaningful values.

Specification for implementors

This class is a mutable context intended for use from a single thread. Usage of the class is thread-safe within standard parsing as a new instance of this class is automatically created for each parse and parsing is single-threaded

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TTBPDateTimeParseContext
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TTBPDateTimeParseContext(other: TTBPDateTimeParseContext)
  2. new TTBPDateTimeParseContext(locale: Locale, symbols: DecimalStyle, chronology: Chronology)
  3. new TTBPDateTimeParseContext(formatter: DateTimeFormatter)

    Creates a new instance of the context.

    Creates a new instance of the context.

    formatter

    the formatter controlling the parse, not null

  4. new TTBPDateTimeParseContext(locale: Locale, symbols: DecimalStyle, overrideChronology: Chronology, overrideZone: ZoneId, caseSensitive: Boolean = true, strict: Boolean = true)

Type Members

  1. final class Parsed extends TemporalAccessor

    Temporary store of parsed data.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addChronologyChangedParser(reducedPrinterParser: ReducedPrinterParser, value: Long, errorPos: Int, successPos: Int): Unit
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def charEquals(ch1: Char, ch2: Char): Boolean

    Helper to compare two char.

    Helper to compare two char. This uses #isCaseSensitive().

    ch1

    the first character

    ch2

    the second character

    returns

    true if equal

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def copy: TTBPDateTimeParseContext

    Creates a copy of this context.

  9. def endOptional(successful: Boolean): Unit

    Ends the parsing of an optional segment of the input.

    Ends the parsing of an optional segment of the input.

    successful

    whether the optional segment was successfully parsed

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def getEffectiveChronology: Chronology

    Gets the effective chronology during parsing.

    Gets the effective chronology during parsing.

    returns

    the effective parsing chronology, not null

  15. def getLocale: Locale

    Gets the locale.

    Gets the locale.

    This locale is used to control localization in the parse except where localization is controlled by the symbols.

    returns

    the locale, not null

  16. def getParsed(field: TemporalField): Long

    Gets the first value that was parsed for the specified field.

    Gets the first value that was parsed for the specified field.

    This searches the results of the parse, returning the first value found for the specified field. No attempt is made to derive a value. The field may have an out of range value. For example, the day-of-month might be set to 50, or the hour to 1000.

    field

    the field to query from the map, null returns null

    returns

    the value mapped to the specified field, null if field was not parsed

  17. def getSymbols: DecimalStyle

    Gets the formatting symbols.

    Gets the formatting symbols.

    The symbols control the localization of numeric parsing.

    returns

    the formatting symbols, not null

  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def isCaseSensitive: Boolean

    Checks if parsing is case sensitive.

    Checks if parsing is case sensitive.

    returns

    true if parsing is case sensitive, false if case insensitive

  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def isStrict: Boolean

    Checks if parsing is strict.

    Checks if parsing is strict.

    Strict parsing requires exact matching of the text and sign styles.

    returns

    true if parsing is strict, false if lenient

  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. def setCaseSensitive(caseSensitive: Boolean): Unit

    Sets whether the parsing is case sensitive or not.

    Sets whether the parsing is case sensitive or not.

    caseSensitive

    changes the parsing to be case sensitive or not from now on

  26. def setLocale(locale: Locale): Unit

    Sets the locale.

    Sets the locale.

    This locale is used to control localization in the print output except where localization is controlled by the symbols.

    locale

    the locale, not null

  27. def setParsed(zone: ZoneId): Unit

    Stores the parsed zone.

    Stores the parsed zone.

    This stores the zone that has been parsed. No validation is performed other than ensuring it is not null.

    zone

    the parsed zone, not null

  28. def setParsed(chrono: Chronology): Unit

    Stores the parsed chronology.

    Stores the parsed chronology.

    This stores the chronology that has been parsed. No validation is performed other than ensuring it is not null.

    chrono

    the parsed chronology, not null

  29. def setParsedField(field: TemporalField, value: Long, errorPos: Int, successPos: Int): Int

    Stores the parsed field.

    Stores the parsed field.

    This stores a field-value pair that has been parsed. The value stored may be out of range for the field - no checks are performed.

    field

    the field to set in the field-value map, not null

    value

    the value to set in the field-value map

    errorPos

    the position of the field being parsed

    successPos

    the position after the field being parsed

    returns

    the new position

  30. def setParsedLeapSecond(): Unit

    Stores the leap second.

  31. def setStrict(strict: Boolean): Unit

    Sets whether parsing is strict or lenient.

    Sets whether parsing is strict or lenient.

    strict

    changes the parsing to be strict or lenient from now on

  32. def startOptional(): Unit

    Starts the parsing of an optional segment of the input.

  33. def subSequenceEquals(cs1: CharSequence, offset1: Int, cs2: CharSequence, offset2: Int, length: Int): Boolean

    Helper to compare two CharSequence instances.

    Helper to compare two CharSequence instances. This uses #isCaseSensitive().

    cs1

    the first character sequence, not null

    offset1

    the offset into the first sequence, valid

    cs2

    the second character sequence, not null

    offset2

    the offset into the second sequence, valid

    length

    the length to check, valid

    returns

    true if equal

  34. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  35. def toParsed: Parsed

    Returns a TemporalAccessor that can be used to interpret the results of the parse.

    Returns a TemporalAccessor that can be used to interpret the results of the parse.

    returns

    an accessor with the results of the parse, not null

  36. def toString(): String

    Returns a string version of the context for debugging.

    Returns a string version of the context for debugging.

    returns

    a string representation of the context data, not null

    Definition Classes
    TTBPDateTimeParseContext → AnyRef → Any
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped