jdk/src/share/classes/sun/util/locale/ParseStatus.java
author okutsu
Thu, 14 Apr 2011 15:59:47 +0900
changeset 9224 75c0420badef
parent 6501 684810d882b3
permissions -rw-r--r--
7028818: (lc) Lazily initialize locale extension 7029740: (lc) New Locale class implementation doesn't follow the Java coding conventions 7032820: (lc) sun.util.locale.InternalLocaleBuilder.CaseInsensitiveChar.equals problems 7033503: (lc) Restore optimization code for Locale class initialization 7033504: (lc) incompatible behavior change for ja_JP_JP and th_TH_TH locales Reviewed-by: naoto
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
     1
/*
9224
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
     2
 * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
     4
 *
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    10
 *
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    15
 * accompanied this code).
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    16
 *
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    20
 *
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    23
 * questions.
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    24
 */
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    25
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    26
/*
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    27
 *******************************************************************************
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    28
 * Copyright (C) 2010, International Business Machines Corporation and         *
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    29
 * others. All Rights Reserved.                                                *
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    30
 *******************************************************************************
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    31
 */
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    32
package sun.util.locale;
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    33
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    34
public class ParseStatus {
9224
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    35
    int parseLength;
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    36
    int errorIndex;
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    37
    String errorMsg;
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    38
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    39
    public ParseStatus() {
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    40
        reset();
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    41
    }
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    42
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    43
    public void reset() {
9224
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    44
        parseLength = 0;
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    45
        errorIndex = -1;
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    46
        errorMsg = null;
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    47
    }
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    48
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    49
    public boolean isError() {
9224
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    50
        return (errorIndex >= 0);
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    51
    }
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    52
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    53
    public int getErrorIndex() {
9224
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    54
        return errorIndex;
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    55
    }
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    56
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    57
    public int getParseLength() {
9224
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    58
        return parseLength;
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    59
    }
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    60
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    61
    public String getErrorMessage() {
9224
75c0420badef 7028818: (lc) Lazily initialize locale extension
okutsu
parents: 6501
diff changeset
    62
        return errorMsg;
6501
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    63
    }
684810d882b3 6875847: Java Locale Enhancement
naoto
parents:
diff changeset
    64
}