/** {@inheritDoc} */
  public String getName(Locale locale) {
    String[] titles = LocaleData.getStringArray(locale, LocaleData.RESOURCE_COLUMNS);
    String result = null;

    if (m_value >= 0 && m_value < titles.length) {
      result = titles[m_value];
    }

    return (result);
  }
  /**
   * This method takes the textual version of a constraint name and returns an appropriate class
   * instance. Note that unrecognised values are treated as "As Soon As Possible" constraints.
   *
   * @param locale target locale
   * @param type text version of the constraint type
   * @return ConstraintType instance
   */
  public static ConstraintType getInstance(Locale locale, String type) {
    int index = 0;

    String[] constraintTypes = LocaleData.getStringArray(locale, LocaleData.CONSTRAINT_TYPES);
    for (int loop = 0; loop < constraintTypes.length; loop++) {
      if (constraintTypes[loop].equalsIgnoreCase(type) == true) {
        index = loop;
        break;
      }
    }

    return (ConstraintType.getInstance(index));
  }
Ejemplo n.º 3
0
  /**
   * This method is used to update the locale specific data used by this class.
   *
   * @param locale target locale
   */
  void setLocale(Locale locale) {
    m_resourceNames = LocaleData.getStringArray(locale, LocaleData.RESOURCE_NAMES);

    String name;
    m_resourceNumbers.clear();

    for (int loop = 0; loop < m_resourceNames.length; loop++) {
      name = m_resourceNames[loop];
      if (name != null) {
        m_resourceNumbers.put(name, Integer.valueOf(loop));
      }
    }
  }