Interface TextElement<V>

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

public interface TextElement<V> extends ChronoElement<V>

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

Author:
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).

      Parameters:
      context - time context with the value of this element
      buffer - format buffer any text output will be sent to
      attributes - query for control attributes
      Throws:
      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.

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