java.lang.Object
com.aquima.interactions.foundation.text.symbol.NumberSymbol
com.aquima.interactions.foundation.text.symbol.SecondSymbol
All Implemented Interfaces:
IDateSymbol, Serializable

public final class SecondSymbol extends NumberSymbol
NumberSymbol class to represent the Calendar.SECOND field in a date string.
Since:
5.1
Author:
C. de Meijer
See Also:
  • Constructor Details

    • SecondSymbol

      public SecondSymbol()
  • Method Details

    • format

      public void format(Calendar c, StringBuffer sb)
      Description copied from interface: IDateSymbol
      Formats this symbol's field of the specified Calendar, and appends it to the StringBuffer.
      Parameters:
      c - Calendar object which holds the date/time that needs to be formatted. The instance is created inside the format method of the DateFormat class.
      sb - StringBuffer in which to place the result of the formatting operation.
    • getCalendarField

      public int getCalendarField()
      Description copied from class: NumberSymbol
      Returns the Calendar field this NumberSymbol represents.
      Specified by:
      getCalendarField in class NumberSymbol
      Returns:
      int Denoting the Calendar field this NumberSymbol represents.
    • getWidth

      public int getWidth()
      Description copied from interface: IDateSymbol
      Returns the width of the symbol. When parsing a date string without separators, this width is used to calculate the expected total string length. When parsing a date string with separators, this width is used to limit the maximum amount of characters to consider. The result of this method is used during formatting to determine the number of leading zeroes required.
      Returns:
      int The width of this symbol.
    • parse

      public int parse(String dateString, int pos, int maxWidth)
      Description copied from interface: IDateSymbol
      Parses part of the dateString parameter. This method may return a negative integer to indicate failure.
      Parameters:
      dateString - String value containing the date/time representation to be parsed.
      pos - Integer value indicating the position at which to start parsing.
      maxWidth - Integer value indicating the maximum number of characters to consume.
      Returns:
      • Non-negative integer containing the value parsed.
      • Negative integer indicating a parse error. (Will be handled by DateFormat by throwing a ParseException indicating the position of the error).
    • getPattern

      public String getPattern()
      Description copied from interface: IDateSymbol
      Return the pattern representation of this NumberSymbol.
      Returns:
      String representing the pattern.
    • toString

      public String toString()
      Overrides:
      toString in class Object