2 *******************************************************************************
\r
3 * Copyright (C) 2009, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 *******************************************************************************
\r
7 package com.ibm.icu.util;
\r
10 * Thrown by methods in Locale class to indicate that a locale string
\r
14 * @provisional This API might change or be removed in a future release.
\r
16 public class IllformedLocaleException extends IllegalArgumentException {
\r
18 private static final long serialVersionUID = 1L;
\r
20 private int _errIdx = -1;
\r
23 * Constructs a new <code>IllformedLocaleException</code> with
\r
24 * the detail message.
\r
25 * @param msg the detail message
\r
27 * @provisional This API might change or be removed in a future release.
\r
29 public IllformedLocaleException(String msg) {
\r
34 * Constructs a new <code>IllformedLocaleException</code> with
\r
35 * the detail message and the error index.
\r
36 * @param msg the detail message
\r
37 * @param errIdx the index where the error is found in a locale string
\r
39 * @provisional This API might change or be removed in a future release.
\r
41 public IllformedLocaleException(String msg, int errIdx) {
\r
42 super(msg + ((errIdx == -1) ? "" : " [at index " + errIdx + "]"));
\r
47 * Returns the index where the error is found in a locale string
\r
48 * @return the index where the error is found in a locale string or
\r
51 * @provisional This API might change or be removed in a future release.
\r
53 public int getErrorIndex() {
\r