StringTokenizer
References
References
The DateFormatSymbols class (in java.text) provides locale-specific data used by DateFormat classes, such as: Month names Day names AM/PM markers Era strings It allows customization of how date and time values are formatted or parsed. Key Features: Helps DateFormat with textual date elements like months and days. Locale-sensitive. Customizable for creating localized or specialized date …
The Format class (in java.text) is an abstract base class used for formatting and parsing locale-sensitive information like numbers, dates, messages, and text. It provides a common interface for all formatting subclasses such as DateFormat, NumberFormat, MessageFormat, etc. Key Features: Serves as the superclass for all formatter classes. Defines the standard methods for formatting objects …
The Bidi class (from java.text) handles bidirectional text layout, which is required when displaying text that mixes left-to-right (LTR) and right-to-left (RTL) scripts (e.g., English + Arabic or Hebrew). It’s primarily used for text rendering engines and internationalized UIs. Key Features: Supports Unicode Bidirectional Algorithm Determines the visual order of characters based on their directionality …
The BreakIterator class (in java.text) is used to identify text boundaries such as words, sentences, lines, and characters. It is locale-sensitive and critical in text-processing applications like editors, search tools, and word counters. Key Features: Locale-aware breaking of text into Words,Sentences,Lines,Characters Supports internationalized text segmentation Abstract class with factory methods for different break types Commonly Used …
he Normalizer class (from java.text in Java 5 and later java.text.Normalizer or java.text.Normalizer.Form) is used to transform Unicode text into a normalized form. This is crucial when comparing, storing, or searching strings that may be visually identical but have different internal Unicode representations (e.g., accented characters). Key Features: Ensures consistent Unicode representation Supports multiple normalization …
The NumberFormat class (from the java.text package) provides methods to format and parse numbers in a locale-sensitive manner. It is commonly used for formatting: General numbers Currency values Percentages Unlike DecimalFormat, NumberFormat provides default formats based on locale and is ideal for user-facing number displays. Key Features Locale-aware formatting Formats currency and percentages Parses strings …
DateFormat is an abstract class in the java.text package used to format and parse dates and times in a locale-sensitive manner. It is often used to convert Date objects to readable strings and parse strings back into Date objects. Key Features Format Date to String Parse String to Date Locale-sensitive formatting Supports different styles (FULL, …
The CollationKey class (in java.text) is used in conjunction with Collator to optimize string comparison operations. When comparing many strings repeatedly, creating a CollationKey for each string once, and then comparing the keys instead of the strings, offers better performance. Key Features: Represents a string in a form that’s optimized for comparison Can be used …
The RuleBasedCollator class, a subclass of Collator in java.text, allows custom string comparison rules. While Collator uses default locale-based rules, RuleBasedCollator gives you explicit control by defining your own rules. This is useful when: Locale rules are insufficient or undesired You need to sort based on domain-specific conventions (e.g., chemical names, custom dictionaries) Key Features: …