java.text
Class PatternEntry

java.lang.Object
  extended byjava.text.PatternEntry

class PatternEntry
extends Object

Utility class for normalizing and merging patterns for collation. This is to be used with MergeCollation for adding patterns to an existing rule table.

Author:
Mark Davis, Helena Shih
See Also:
MergeCollation

Nested Class Summary
(package private) static class PatternEntry.Parser
           
 
Field Summary
(package private)  String chars
           
(package private)  String extension
           
(package private) static int RESET
           
(package private)  int strength
           
(package private) static int UNSET
           
 
Constructor Summary
(package private) PatternEntry(int strength, StringBuffer chars, StringBuffer extension)
           
 
Method Summary
(package private)  void addToBuffer(StringBuffer toAddTo, boolean showExtension, boolean showWhiteSpace, PatternEntry lastEntry)
           
(package private) static void appendQuoted(String chars, StringBuffer toAddTo)
           
 void appendQuotedChars(StringBuffer toAddTo)
          Gets the current chars, quoted
 void appendQuotedExtension(StringBuffer toAddTo)
          Gets the current extension, quoted
 boolean equals(Object obj)
          WARNING this is used for searching in a Vector.
(package private)  String getChars()
          Gets the core characters of the entry.
(package private)  String getExtension()
          Gets the expanding characters of the entry.
(package private)  int getStrength()
          Gets the strength of the entry.
 int hashCode()
          Returns a hash code value for the object.
(package private) static boolean isSpecialChar(char ch)
           
 String toString()
          For debugging.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESET

static final int RESET
See Also:
Constant Field Values

UNSET

static final int UNSET
See Also:
Constant Field Values

strength

int strength

chars

String chars

extension

String extension
Constructor Detail

PatternEntry

PatternEntry(int strength,
             StringBuffer chars,
             StringBuffer extension)
Method Detail

appendQuotedExtension

public void appendQuotedExtension(StringBuffer toAddTo)
Gets the current extension, quoted


appendQuotedChars

public void appendQuotedChars(StringBuffer toAddTo)
Gets the current chars, quoted


equals

public boolean equals(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.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), Hashtable

hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

toString

public String toString()
For debugging.

Overrides:
toString in class Object
Returns:
a string representation of the object.

getStrength

final int getStrength()
Gets the strength of the entry.


getExtension

final String getExtension()
Gets the expanding characters of the entry.


getChars

final String getChars()
Gets the core characters of the entry.


addToBuffer

void addToBuffer(StringBuffer toAddTo,
                 boolean showExtension,
                 boolean showWhiteSpace,
                 PatternEntry lastEntry)

appendQuoted

static void appendQuoted(String chars,
                         StringBuffer toAddTo)

isSpecialChar

static boolean isSpecialChar(char ch)