Interface TextElement<V>

Type Parameters:
V - generic type of element values
All Superinterfaces:
ChronoElement<V>, Comparator<ChronoDisplay>
All Known Subinterfaces:

public interface TextElement<V> extends ChronoElement<V>

A chronological element which can be formatted as text or can be parsed from a text.

Meno Hochschild
  • Method Details

    • print

      void print(ChronoDisplay context, Appendable buffer, AttributeQuery attributes) throws IOException, ChronoException

      Converts the element value in given context to a formatted text.

      Implementation note: The concrete element value is obtainable by the expression context.get(this).

      context - time context with the value of this element
      buffer - format buffer any text output will be sent to
      attributes - query for control attributes
      IOException - if writing to buffer fails
      ChronoException - if there is no suitable element rule for evaluating the value
    • parse

      V parse(CharSequence text, ParsePosition status, AttributeQuery attributes)

      Interpretes the given text as element value.

      Implementation note: Any implementation will start first at the position status.getIndex() and either set the new position after successful parsing or return null in case of error.

      text - text to be parsed
      status - current parsing position
      attributes - query for control attributes
      parsed element value or null if parsing was not successful