Class SeparatorSymbol

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

public class SeparatorSymbol extends Object implements IDateSymbol
This class represents a separator in a date/time string representation of a Date object. Several commonly used instances are defined as public members of this class. These public members are 'imported' in de DateFormat class as a matter of convenience.
Since:
5.1
Author:
C. de Meijer
See Also:
  • Constructor Details

  • Method Details

    • format

      public void format(Calendar c, StringBuffer sb)
      Formats this symbol separator. It simply appends the separator symbol to the specified StringBuffer.
      Specified by:
      format in interface IDateSymbol
      Parameters:
      c - Calendar object which holds the date/time that needs to be formatted. This parameter is ignored.
      sb - StringBuffer in which to place the separator symbol.
    • getWidth

      public int getWidth()
      Returns the width of the separator symbol.
      Specified by:
      getWidth in interface IDateSymbol
      Returns:
      int The width of this separator symbol.
    • parse

      public int parse(String dateString, int pos, int maxWidth)
      Parses part of the dateString parameter. This method will return a negative integer if the symbol is not equal to the substring starting at pos and up to maxWidth characters of the dateString parameter.

      The result of this method may be the following:

      • The width of this separator symbol upon succes.
      • Negative integer indicating a parse error if the substring indicated by the pos and maxWidth parameters is not equal to this separator symbol. (Will be handled by DateFormat by throwing a ParseException indicating the position of the error).
      Specified by:
      parse in interface IDateSymbol
      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:
      The with of the separator symbol, or a negative number when a parse error was encountered.
    • getSymbol

      public String getSymbol()
      Returns this SeparatorSymbol's instance's symbol.
      Returns:
      String containing the separator symbol of this instance.
    • getPattern

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

      public String toString()
      Overrides:
      toString in class Object