Class FormatEngine
java.lang.Object
io.github.connellite.format.internal.FormatEngine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompiledFormatcompile(CharSequence pattern) Parsespatternwithout consulting the compile cache.static CompiledFormatcompileCached(CharSequence pattern) Same ascompile(java.lang.CharSequence), but reuses a previous result for patterns of at mostMAX_CACHED_PATTERN_LENGTHcharacters.static Stringformat(CompiledFormat compiled, Object[] args, Locale locale) static voidformatTo(Appendable out, CompiledFormat compiled, Object[] args, Locale locale) static void
-
Constructor Details
-
FormatEngine
public FormatEngine()
-
-
Method Details
-
compileCached
Same ascompile(java.lang.CharSequence), but reuses a previous result for patterns of at mostMAX_CACHED_PATTERN_LENGTHcharacters. Longer patterns are compiled and not stored. -
compile
Parsespatternwithout consulting the compile cache. Each call returns a new instance. -
format
-
formatTo
-
formatTo
public static void formatTo(Consumer<? super String> sink, CompiledFormat compiled, Object[] args, Locale locale)
-