Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
A
- addLikelySubtags() - Method in class com.miloun.cosmo.Cosmo
-
A new Cosmo with likely subtags added (
"en"→"en_Latn_US").
B
- bestMatch(Collection<String>) - Method in class com.miloun.cosmo.Cosmo
-
The supported locale that best serves this Cosmo's locale, using CLDR language-distance data — e.g.
- BRKITR - Static variable in class com.miloun.cosmo.Bundle
-
Break-iterator rule source data.
- Bundle - Class in com.miloun.cosmo
-
Names of the ICU resource bundles reachable through
Cosmo.get(java.lang.String, java.lang.String...).
C
- calendar - Variable in class com.miloun.cosmo.Modifiers
-
Calendar keyword, e.g.
- calendar(String) - Method in class com.miloun.cosmo.Cosmo
-
Localised calendar name (
"buddhist"→"Buddhist Calendar"). - com.miloun.cosmo - package com.miloun.cosmo
- compact(double) - Method in class com.miloun.cosmo.Cosmo
-
Compact notation (
1200→"1.2K"). - compact(double, String) - Method in class com.miloun.cosmo.Cosmo
-
Compact notation;
"full"/"long"width gives"1.2 thousand". - compare(String, String) - Method in class com.miloun.cosmo.Cosmo
-
Locale-aware comparison of two strings (negative / zero / positive).
- compare(String, String, Map<String, Object>) - Method in class com.miloun.cosmo.Cosmo
-
Locale-aware comparison with optional collation tailoring —
numeric(boolean) andcaseFirst("upper"/"lower"/"false"). - confusable(String, String) - Method in class com.miloun.cosmo.Cosmo
-
Whether two strings are visually confusable (
"paypal"vs a Cyrillic"раураl") per UTS #39. - contains(String, String) - Method in class com.miloun.cosmo.Cosmo
-
Locale-aware substring test ignoring case and accents.
- contains(String, String, String) - Method in class com.miloun.cosmo.Cosmo
-
Locale-aware substring test with an explicit sensitivity.
- contains(String, String, String, Map<String, Object>) - Method in class com.miloun.cosmo.Cosmo
-
Locale-aware substring test (accents/case can be ignored).
- Cosmo - Class in com.miloun.cosmo
-
Cosmo — application localisation for Java.
- Cosmo(String) - Constructor for class com.miloun.cosmo.Cosmo
-
Builds a Cosmo for the given locale with no modifier overrides.
- Cosmo(String, Modifiers) - Constructor for class com.miloun.cosmo.Cosmo
- CosmoException - Exception in com.miloun.cosmo
-
Base exception for cosmo.
- CosmoException(String) - Constructor for exception com.miloun.cosmo.CosmoException
- CosmoException(String, Throwable) - Constructor for exception com.miloun.cosmo.CosmoException
- country() - Method in class com.miloun.cosmo.Cosmo
-
Localised name of this locale's own region.
- country(String) - Method in class com.miloun.cosmo.Cosmo
-
Localised country/region name (
"AU"→"Australia"). - currency - Variable in class com.miloun.cosmo.Modifiers
-
ISO 4217 currency code used as the default for
Cosmo.money(double). - currency() - Method in class com.miloun.cosmo.Cosmo
-
Localised name of the
currencymodifier's currency. - currency(String) - Method in class com.miloun.cosmo.Cosmo
-
Localised currency name (
"AUD"→"Australian Dollar"). - currency(String, boolean, boolean) - Method in class com.miloun.cosmo.Cosmo
-
Localised currency name (default) or symbol.
- CURRENCY - Static variable in class com.miloun.cosmo.Bundle
-
Currency symbols and display names.
D
- date(Instant, String) - Method in class com.miloun.cosmo.Cosmo
- date(Date) - Method in class com.miloun.cosmo.Cosmo
-
Format just the date part of a moment (short width).
- date(Date, String) - Method in class com.miloun.cosmo.Cosmo
-
Format just the date part of a moment.
- dateRange(Date, Date) - Method in class com.miloun.cosmo.Cosmo
-
Format a moment range with medium-width dates (
"Feb 2 – 5, 2020"). - dateRange(Date, Date, String, String) - Method in class com.miloun.cosmo.Cosmo
-
Format a moment range; supports the documented width combinations only.
- direction() - Method in class com.miloun.cosmo.Cosmo
-
Text direction of this locale:
"rtl"or"ltr". - direction(String) - Method in class com.miloun.cosmo.Cosmo
-
Text direction of a language:
"rtl"or"ltr". - displayName(String, String) - Method in class com.miloun.cosmo.Cosmo
-
Generic localised display name — one entry point over the dedicated lookups.
- duration(double) - Method in class com.miloun.cosmo.Cosmo
-
Format an undirected duration in seconds as the clock form (
"339:17:20"). - duration(double, boolean) - Method in class com.miloun.cosmo.Cosmo
-
Format an undirected duration in seconds.
- duration(Map<String, ?>) - Method in class com.miloun.cosmo.Cosmo
-
Format a multi-unit duration map with abbreviated units (
"3 hr, 5 min"). - duration(Map<String, ?>, boolean) - Method in class com.miloun.cosmo.Cosmo
-
Format a multi-unit duration (
{hours: 3, minutes: 5}→"3 hours, 5 minutes"withwithWords).
E
- ellipsize(String, int) - Method in class com.miloun.cosmo.Cosmo
-
Truncate to at most
maxGraphemesgraphemes on a word boundary. - ellipsize(String, int, String) - Method in class com.miloun.cosmo.Cosmo
-
Truncate to at most
maxGraphemesgraphemes with a custom ellipsis.
F
- firstDay - Variable in class com.miloun.cosmo.WeekInfo
-
First day of the week, ISO numbering.
- flag() - Method in class com.miloun.cosmo.Cosmo
-
Country flag emoji for this locale's region (
""when it has none). - flag(String) - Method in class com.miloun.cosmo.Cosmo
-
Country flag emoji for a region (
"AU"→"🇦🇺"). - formatMoment(Date, String) - Method in class com.miloun.cosmo.Cosmo
-
Format a moment with a raw ICU pattern (
"yyyy-MM-dd"). - formatMoment(Date, String, String) - Method in class com.miloun.cosmo.Cosmo
-
Format a moment with a raw ICU pattern, forcing a calendar (
"gregorian", …). - fromAcceptLanguage(String) - Static method in class com.miloun.cosmo.Cosmo
-
Builds a Cosmo from an HTTP
Accept-Languageheader. - fromAcceptLanguage(String, Modifiers) - Static method in class com.miloun.cosmo.Cosmo
-
Builds a Cosmo from an HTTP
Accept-Languageheader, picking the best-quality tag. - fromAcceptLanguage(String, Collection<String>) - Static method in class com.miloun.cosmo.Cosmo
-
Negotiating variant of
Cosmo.fromAcceptLanguage(String, Collection, Modifiers). - fromAcceptLanguage(String, Collection<String>, Modifiers) - Static method in class com.miloun.cosmo.Cosmo
-
Builds a Cosmo for the supported locale that best serves an HTTP
Accept-Languageheader, negotiated with CLDR language-distance data (seeCosmo.bestMatch(java.util.Collection<java.lang.String>)). - fromSubtags(Subtags) - Static method in class com.miloun.cosmo.Cosmo
-
Builds a Cosmo from locale subtags, e.g.
- fromSubtags(Subtags, Modifiers) - Static method in class com.miloun.cosmo.Cosmo
-
Builds a Cosmo from locale subtags instead of a string.
G
- get(String, String...) - Method in class com.miloun.cosmo.Cosmo
-
Read a value from an ICU resource bundle, falling back locale → language → root.
I
- indexBuckets(Collection<String>) - Method in class com.miloun.cosmo.Cosmo
-
Group strings under locale-correct index headers (A–Z in en, 가나다 in ko, あかさ in ja, with the right under/overflow buckets).
- InvalidArgumentException - Exception in com.miloun.cosmo
-
A caller passed an invalid argument — an unknown currency code, an unsupported width/unit, a bad enum value, …
- InvalidArgumentException(String) - Constructor for exception com.miloun.cosmo.InvalidArgumentException
J
- join(Collection<String>) - Method in class com.miloun.cosmo.Cosmo
-
Join a list the locale's way (
"A, B, and C"). - join(Collection<String>, String) - Method in class com.miloun.cosmo.Cosmo
-
Join a list;
typeisconjunction(and),disjunction(or), orunit. - join(Collection<String>, String, String) - Method in class com.miloun.cosmo.Cosmo
-
Join a list the locale's way with an explicit type and width.
L
- language - Variable in class com.miloun.cosmo.Subtags
- language() - Method in class com.miloun.cosmo.Cosmo
-
Localised name of this locale's own language.
- language(String) - Method in class com.miloun.cosmo.Cosmo
-
Localised language name (
"en"→"English"). - LANGUAGE - Static variable in class com.miloun.cosmo.Bundle
-
Language / script / calendar display names.
- locale - Variable in class com.miloun.cosmo.Cosmo
-
Canonical ICU locale id, e.g.
- LOCALE - Static variable in class com.miloun.cosmo.Bundle
-
The per-locale bundle (delimiters, layout, …).
- lower(String) - Method in class com.miloun.cosmo.Cosmo
-
Locale-aware lower-casing.
M
- message(String, Object...) - Method in class com.miloun.cosmo.Cosmo
-
Format an ICU MessageFormat pattern with positional (
{0}) placeholders. - message(String, Map<String, Object>) - Method in class com.miloun.cosmo.Cosmo
-
Format an ICU MessageFormat pattern with named placeholders.
- minimalDays - Variable in class com.miloun.cosmo.WeekInfo
-
Minimal days required in the first week of the year.
- modifiers - Variable in class com.miloun.cosmo.Cosmo
-
Resolved modifiers (calendar / currency / timeZone).
- Modifiers - Class in com.miloun.cosmo
-
Optional overrides resolved at construction:
calendar,currencyandtimeZone. - Modifiers(String, String, String) - Constructor for class com.miloun.cosmo.Modifiers
- moment(Instant, String, String) - Method in class com.miloun.cosmo.Cosmo
- moment(Date, String, String) - Method in class com.miloun.cosmo.Cosmo
-
Format a date and/or time using the locale's conventions.
- money(double) - Method in class com.miloun.cosmo.Cosmo
-
Formats a monetary value using the
currencymodifier (inferred from the region when the locale has one). - money(double, String) - Method in class com.miloun.cosmo.Cosmo
-
Formats a monetary value in the given ISO 4217 currency.
- money(double, String, Integer, boolean) - Method in class com.miloun.cosmo.Cosmo
-
Formats a monetary value.
- money(double, String, Integer, boolean, Map<String, Object>) - Method in class com.miloun.cosmo.Cosmo
-
Formats a monetary value; see
Cosmo.number(double, Map)for the options. - moneyRange(double, double) - Method in class com.miloun.cosmo.Cosmo
-
Format a monetary range with the
currencymodifier (""if none). - moneyRange(double, double, String) - Method in class com.miloun.cosmo.Cosmo
-
Format a monetary range (
"$3.00 – $5.00"). - monthNames() - Method in class com.miloun.cosmo.Cosmo
-
Localised month names (full width), following the active calendar.
- monthNames(String) - Method in class com.miloun.cosmo.Cosmo
-
Localised month names, following the active calendar (e.g.
N
- none() - Static method in class com.miloun.cosmo.Modifiers
-
All-null modifiers — everything derived from the locale.
- number(double) - Method in class com.miloun.cosmo.Cosmo
-
Format a number with the locale's default decimal format.
- number(double, Map<String, Object>) - Method in class com.miloun.cosmo.Cosmo
-
Format a number with optional portable controls —
minimumIntegerDigits,minimum/maximumFractionDigits,minimum/maximumSignificantDigits,roundingMode,roundingIncrement,useGrouping. - numberRange(double, double) - Method in class com.miloun.cosmo.Cosmo
-
Format a numeric range (
"3–5").
O
- ordinal(long) - Method in class com.miloun.cosmo.Cosmo
-
Ordinal text (
1→"1st").
P
- parseDate(String) - Method in class com.miloun.cosmo.Cosmo
-
Parse a short-width localised date.
- parseDate(String, String) - Method in class com.miloun.cosmo.Cosmo
-
Parse a localised date written at the given width (
short…full). - parseMoment(String, String) - Method in class com.miloun.cosmo.Cosmo
-
Parse a moment with a raw ICU pattern (the inverse of
Cosmo.formatMoment(java.util.Date, java.lang.String)). - parseMoney(String) - Method in class com.miloun.cosmo.Cosmo
-
Parse a localised monetary string (
"$12.30"→ 12.3 USD). - parseNumber(String) - Method in class com.miloun.cosmo.Cosmo
-
Parse a localised number (
"1.234,56"in de →1234.56). - percentage(double) - Method in class com.miloun.cosmo.Cosmo
-
Format a fraction as a percentage (
0.2→"20%"). - percentage(double, int) - Method in class com.miloun.cosmo.Cosmo
-
Format a fraction as a percentage with at most
precisionfraction digits. - percentage(double, int, Map<String, Object>) - Method in class com.miloun.cosmo.Cosmo
-
Format a fraction as a percentage; see
Cosmo.number(double, Map)for the options. - personName(Map<String, String>) - Method in class com.miloun.cosmo.Cosmo
-
Format a person's name with medium length and formal formality.
- personName(Map<String, String>, String, String) - Method in class com.miloun.cosmo.Cosmo
-
Locale-aware person-name formatting from CLDR person-name data: surname-first locales (ja/zh/hu), locale-correct initials and spacing, formality variants — zero hardcoded rules.
- pluralCategory(double) - Method in class com.miloun.cosmo.Cosmo
-
The LDML cardinal plural category for a value (
1→"one"). - pluralCategory(double, boolean) - Method in class com.miloun.cosmo.Cosmo
-
The LDML plural category;
ordinaluses ordinal rules (1st/2nd/3rd …).
Q
- quote(String) - Method in class com.miloun.cosmo.Cosmo
-
Wrap text in the locale's quotation marks (
“x”in en,«x»in fa).
R
- region - Variable in class com.miloun.cosmo.Subtags
- relativeDuration(double, String) - Method in class com.miloun.cosmo.Cosmo
-
Directed duration, always numeric (
(-3, "day")→"3 days ago"). - relativeDuration(double, String, String) - Method in class com.miloun.cosmo.Cosmo
-
Render a directed duration.
- relativeDurationBetween(Date) - Method in class com.miloun.cosmo.Cosmo
-
Directed duration between a moment and now, largest sensible unit, word forms allowed.
- relativeDurationBetween(Date, Date) - Method in class com.miloun.cosmo.Cosmo
-
Directed duration between two moments (
"in 5 days","3 days ago"). - relativeDurationBetween(Date, Date, String) - Method in class com.miloun.cosmo.Cosmo
-
Directed duration between two moments, computed as
target − reference(referencedefaults to now) and rendered in the largest sensible unit. - removeLikelySubtags() - Method in class com.miloun.cosmo.Cosmo
-
A new Cosmo with likely subtags removed (
"en_Latn_US"→"en"). - romanize(String) - Method in class com.miloun.cosmo.Cosmo
-
Romanise text (
"Москва"→"Moskva"); shorthand forAny-Latin.
S
- scientific(double) - Method in class com.miloun.cosmo.Cosmo
-
Scientific notation (
12345→"1.2345E4"). - script - Variable in class com.miloun.cosmo.Subtags
- script() - Method in class com.miloun.cosmo.Cosmo
-
Localised name of this locale's own script (
""when it has none). - script(String) - Method in class com.miloun.cosmo.Cosmo
-
Localised script name (
"Hans"→"Simplified"). - sort(Collection<String>) - Method in class com.miloun.cosmo.Cosmo
-
A new list sorted by the locale's collation rules.
- sort(Collection<String>, Map<String, Object>) - Method in class com.miloun.cosmo.Cosmo
-
A new sorted list with optional collation tailoring (see
Cosmo.compare(String, String, Map)). - spellout(double) - Method in class com.miloun.cosmo.Cosmo
-
Spell a number out (
42→"forty-two"). - splitGraphemes(String) - Method in class com.miloun.cosmo.Cosmo
-
Split text into grapheme clusters (combining marks / emoji stay intact).
- splitSentences(String) - Method in class com.miloun.cosmo.Cosmo
-
Split text into sentences using the locale's boundary rules.
- splitWords(String) - Method in class com.miloun.cosmo.Cosmo
-
Split text into words (drops whitespace/punctuation).
- subtags - Variable in class com.miloun.cosmo.Cosmo
-
Parsed language / script / region subtags.
- Subtags - Class in com.miloun.cosmo
-
Parsed language / script / region subtags of a locale.
- Subtags(String, String, String) - Constructor for class com.miloun.cosmo.Subtags
- supportedValues(String) - Method in class com.miloun.cosmo.Cosmo
-
Values the runtime's ICU supports for
key(e.g. all IANA time zones). - suspicious(String) - Method in class com.miloun.cosmo.Cosmo
-
Whether a string fails ICU's default spoof checks (mixed scripts, restriction level, invisible characters) per UTS #39.
- symbol(String) - Method in class com.miloun.cosmo.Cosmo
-
Returns a localised number symbol (
"decimal","percent", …).
T
- time(Instant, String) - Method in class com.miloun.cosmo.Cosmo
- time(Date) - Method in class com.miloun.cosmo.Cosmo
-
Format just the time (clock) part of a moment (short width).
- time(Date, String) - Method in class com.miloun.cosmo.Cosmo
-
Format just the time (clock) part of a moment.
- timeZone - Variable in class com.miloun.cosmo.Modifiers
-
IANA time-zone id, e.g.
- timeZoneName() - Method in class com.miloun.cosmo.Cosmo
-
Display name of the
timeZonemodifier (or the system zone), long style. - timeZoneName(String) - Method in class com.miloun.cosmo.Cosmo
-
Display name of the
timeZonemodifier (or the system zone). - transliterate(String, String) - Method in class com.miloun.cosmo.Cosmo
-
Run an ICU transform over the text — script conversion, romanisation, accent folding (
"Any-Latin; Latin-ASCII"makes ASCII slugs).
U
- unit(String, String, double) - Method in class com.miloun.cosmo.Cosmo
-
Format a measurement with a localised unit, full width.
- unit(String, String, double, String) - Method in class com.miloun.cosmo.Cosmo
-
Format a measurement with a localised unit (
2.19gigabytes). - UnsupportedException - Exception in com.miloun.cosmo
-
The underlying ICU4J build exposes no API for the requested operation.
- UnsupportedException(String) - Constructor for exception com.miloun.cosmo.UnsupportedException
- upper(String) - Method in class com.miloun.cosmo.Cosmo
-
Locale-aware upper-casing (e.g.
W
- weekdayNames() - Method in class com.miloun.cosmo.Cosmo
-
Localised weekday names (full width), Sunday first (ICU symbol order).
- weekdayNames(String) - Method in class com.miloun.cosmo.Cosmo
-
Localised weekday names, Sunday first (ICU symbol order).
- weekend - Variable in class com.miloun.cosmo.WeekInfo
-
Weekend days, ISO numbering, in onset → cease order.
- weekInfo() - Method in class com.miloun.cosmo.Cosmo
-
Week conventions of the locale's region: first day, minimal days, and — unlike the Python port — the weekend days, via ICU's region week data.
- WeekInfo - Class in com.miloun.cosmo
-
Week conventions for a locale's region.
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form