APIdia Launch Partner
Top Description Fields Constructors Methods
java.text

pack-priv final Class MergeCollation

extends Object
Class Inheritance
Imports
java.util.ArrayList

Utility class for normalizing and merging patterns for collation. Patterns are strings of the form *, where has the form: := * := {"/"} := "=", ",", ";", "<", "&" , and are both arbitrary strings. unquoted whitespaces are ignored. 'xxx' can be used to quote characters One difference from Collator is that & is used to reset to a current point. Or, in other words, it introduces a new sequence which is to be added to the old. That is: "a < b < c < d" is the same as "a < b & b < c & c < d" OR "a < b < d & b < c" XXX: make '' be a single quote.
Author
Mark Davis, Helena Shih
See Also
PatternEntry

Field Summary

Modifier and TypeField and Description
private static final byte
private static final int
private static final int
private transient StringBuilder
private transient PatternEntry
pack-priv ArrayList<PatternEntry>
private transient PatternEntry
private transient byte[]

Constructor Summary

AccessConstructor and Description
public
MergeCollation(String pattern)

Creates from a pattern

Method Summary

Modifier and TypeMethod and Description
public void
addPattern(String
the new pattern to be added
pattern
)

adds a pattern to the current one.

public String

Returns:

emits the string in the format understable to the collation builder.
emitPattern
()

emits the pattern for collation builder.

public String

Returns:

emits the string in the format understable to the collation builder.
emitPattern
(boolean
puts spacing around the entries, and \n before & and <
withWhiteSpace
)

emits the pattern for collation builder.

private final int
private final PatternEntry
private final void
public int

Returns:

the size of pattern entries
getCount
()

gets count of separate entries

public PatternEntry

Returns:

the requested pattern entry
getItemAt
(int
the offset of the desired pattern entry
index
)

gets count of separate entries

public String
getPattern()

recovers current pattern

public String
getPattern(boolean
puts spacing around the entries, and \n before & and <
withWhiteSpace
)

recovers current pattern.

public void
setPattern(String pattern)

sets the pattern.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BITARRAYMASKback to summary
private static final byte BITARRAYMASK
BYTEMASKback to summary
private static final int BYTEMASK
BYTEPOWERback to summary
private static final int BYTEPOWER
excessback to summary
private transient StringBuilder excess
lastEntryback to summary
private transient PatternEntry lastEntry
patternsback to summary
pack-priv ArrayList<PatternEntry> patterns
saveEntryback to summary
private transient PatternEntry saveEntry
statusArrayback to summary
private transient byte[] statusArray

Constructor Detail

MergeCollationback to summary
public MergeCollation(String pattern) throws ParseException

Creates from a pattern

Exceptions
ParseException:
If the input pattern is incorrect.

Method Detail

addPatternback to summary
public void addPattern(String pattern) throws ParseException

adds a pattern to the current one.

Parameters
pattern:String

the new pattern to be added

emitPatternback to summary
public String emitPattern()

emits the pattern for collation builder.

Returns:String

emits the string in the format understable to the collation builder.

emitPatternback to summary
public String emitPattern(boolean withWhiteSpace)

emits the pattern for collation builder.

Parameters
withWhiteSpace:boolean

puts spacing around the entries, and \n before & and <

Returns:String

emits the string in the format understable to the collation builder.

findLastEntryback to summary
private final int findLastEntry(PatternEntry entry, StringBuilder excessChars) throws ParseException
findLastWithNoExtensionback to summary
private final PatternEntry findLastWithNoExtension(int i)
fixEntryback to summary
private final void fixEntry(PatternEntry newEntry) throws ParseException
getCountback to summary
public int getCount()

gets count of separate entries

Returns:int

the size of pattern entries

getItemAtback to summary
public PatternEntry getItemAt(int index)

gets count of separate entries

Parameters
index:int

the offset of the desired pattern entry

Returns:PatternEntry

the requested pattern entry

getPatternback to summary
public String getPattern()

recovers current pattern

getPatternback to summary
public String getPattern(boolean withWhiteSpace)

recovers current pattern.

Parameters
withWhiteSpace:boolean

puts spacing around the entries, and \n before & and <

setPatternback to summary
public void setPattern(String pattern) throws ParseException

sets the pattern.