Package org.dellroad.stuff.text
Class MessageFmt.ChoiceArgumentSegment.Option
java.lang.Object
org.dellroad.stuff.text.MessageFmt.ChoiceArgumentSegment.Option
- Enclosing class:
- MessageFmt.ChoiceArgumentSegment
Represents one option in a
MessageFmt.ChoiceArgumentSegment.
An option is chosen if the number to be formatted is no less than getLimit()
and also strictly less than the next option's limit (if any).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull @Valid MessageFmtGet theMessageFmtfor thisMessageFmt.ChoiceArgumentSegmentoption.doublegetLimit()Get the limit for thisMessageFmt.ChoiceArgumentSegmentoption.Get the limit for thisMessageFmt.ChoiceArgumentSegmentoption in string form.inthashCode()voidsetFormat(MessageFmt format) voidsetLimit(double limit) voidsetLimitDescription(String limitDescription) Set the limit for thisMessageFmt.ChoiceArgumentSegmentoption in string form.toString()
-
Constructor Details
-
Option
public Option() -
Option
-
-
Method Details
-
getLimit
public double getLimit()Get the limit for thisMessageFmt.ChoiceArgumentSegmentoption.- Returns:
- argument upper bound (inclusive) for this option
-
setLimit
public void setLimit(double limit) -
getLimitDescription
Get the limit for thisMessageFmt.ChoiceArgumentSegmentoption in string form.This property is just an alternative view of
getLimit()that uses theChoiceFormatstring syntax, which includes a trailing"<"or"#"character.For example, a limit of
1.0is described as"1.0#"while a limit ofChoiceFormat.nextDouble(1.0)is described as"1.0<".- Returns:
- argument upper bound (inclusive) for this option
-
setLimitDescription
Set the limit for thisMessageFmt.ChoiceArgumentSegmentoption in string form.If there is no trailing
"<"or"#"character, then"#"is assumed.- Parameters:
limitDescription- string description of limit
-
getFormat
Get theMessageFmtfor thisMessageFmt.ChoiceArgumentSegmentoption.Note: whereas the options in a
ChoiceFormatare format strings, in the context of aMessageFormata choice-formatted argument format string is interpreted as a nestedMessageFormatpattern, therefore this property has typeMessageFmtinstead ofString.- Returns:
- the
MessageFmtfor this option
-
setFormat
-
equals
-
hashCode
public int hashCode() -
toString
-