/*
*******************************************************************************
- * Copyright (C) 1996-2011, International Business Machines Corporation and *
+ * Copyright (C) 1996-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
*/
private boolean isFractionRuleSet = false;
+ /**
+ * True if the rule set is parseable.
+ */
+ private boolean isParseable = true;
+
/**
* Used to limit recursion for bad rule sets.
*/
throw new IllegalArgumentException("Empty rule set description");
}
+ if ( name.endsWith("@noparse")) {
+ name = name.substring(0,name.length()-8); // Remove the @noparse from the name
+ isParseable = false;
+ }
+
// all of the other members of NFRuleSet are initialized
// by parseRules()
}
return true;
}
}
+
+ public int hashCode() {
+ assert false : "hashCode not designed";
+ return 42;
+ }
/**
* @return true if the rule set can be used for parsing.
*/
public boolean isParseable() {
- //TODO:
- // In CLDR 1.7, we have no distinction between
- // parseable/unparseable. Rules which have one of
- // 3 suffixes below are know as unparseable for now.
- // We should add the information in CLDR data.
- return !(name.endsWith("-prefixpart")
- || name.endsWith("-postfixpart")
- || name.endsWith("-postfx"));
+ return (isParseable);
}
//-----------------------------------------------------------------------
int hi = rules.length;
if (hi > 0) {
while (lo < hi) {
- int mid = (lo + hi) / 2;
+ int mid = (lo + hi) >>> 1;
if (rules[mid].getBaseValue() == number) {
return rules[mid];
}
// that determines the value we return.
ParsePosition highWaterMark = new ParsePosition(0);
- Number result = new Long(0);
+ Number result = Long.valueOf(0);
Number tempResult = null;
// dump out if there's no text to parse