Methods Summary |
---|
void | addToBuffer(java.lang.StringBuffer toAddTo, boolean showExtension, boolean showWhiteSpace, java.text.PatternEntry lastEntry)
if (showWhiteSpace && toAddTo.length() > 0)
if (strength == Collator.PRIMARY || lastEntry != null)
toAddTo.append('\n");
else
toAddTo.append(' ");
if (lastEntry != null) {
toAddTo.append('&");
if (showWhiteSpace)
toAddTo.append(' ");
lastEntry.appendQuotedChars(toAddTo);
appendQuotedExtension(toAddTo);
if (showWhiteSpace)
toAddTo.append(' ");
}
switch (strength) {
case Collator.IDENTICAL: toAddTo.append('="); break;
case Collator.TERTIARY: toAddTo.append(',"); break;
case Collator.SECONDARY: toAddTo.append(';"); break;
case Collator.PRIMARY: toAddTo.append('<"); break;
case RESET: toAddTo.append('&"); break;
case UNSET: toAddTo.append('?"); break;
}
if (showWhiteSpace)
toAddTo.append(' ");
appendQuoted(chars,toAddTo);
if (showExtension && extension.length() != 0) {
toAddTo.append('/");
appendQuoted(extension,toAddTo);
}
|
static void | appendQuoted(java.lang.String chars, java.lang.StringBuffer toAddTo)
boolean inQuote = false;
char ch = chars.charAt(0);
if (Character.isSpaceChar(ch)) {
inQuote = true;
toAddTo.append('\'");
} else {
if (PatternEntry.isSpecialChar(ch)) {
inQuote = true;
toAddTo.append('\'");
} else {
switch (ch) {
case 0x0010: case '\f": case '\r":
case '\t": case '\n": case '@":
inQuote = true;
toAddTo.append('\'");
break;
case '\'":
inQuote = true;
toAddTo.append('\'");
break;
default:
if (inQuote) {
inQuote = false; toAddTo.append('\'");
}
break;
}
}
}
toAddTo.append(chars);
if (inQuote)
toAddTo.append('\'");
|
public void | appendQuotedChars(java.lang.StringBuffer toAddTo)Gets the current chars, quoted
appendQuoted(chars,toAddTo);
|
public void | appendQuotedExtension(java.lang.StringBuffer toAddTo)Gets the current extension, quoted
appendQuoted(extension,toAddTo);
|
public boolean | equals(java.lang.Object obj)WARNING this is used for searching in a Vector.
Because Vector.indexOf doesn't take a comparator,
this method is ill-defined and ignores strength.
if (obj == null) return false;
PatternEntry other = (PatternEntry) obj;
boolean result = chars.equals(other.chars);
return result;
|
final java.lang.String | getChars()Gets the core characters of the entry.
return chars;
|
final java.lang.String | getExtension()Gets the expanding characters of the entry.
return extension;
|
final int | getStrength()Gets the strength of the entry.
return strength;
|
public int | hashCode()
return chars.hashCode();
|
static boolean | isSpecialChar(char ch)
return ((ch == '\u0020") ||
((ch <= '\u002F") && (ch >= '\u0022")) ||
((ch <= '\u003F") && (ch >= '\u003A")) ||
((ch <= '\u0060") && (ch >= '\u005B")) ||
((ch <= '\u007E") && (ch >= '\u007B")));
|
public java.lang.String | toString()For debugging.
StringBuffer result = new StringBuffer();
addToBuffer(result, true, false, null);
return result.toString();
|