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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
@NotNull @Valid MessageFmt
Get theMessageFmt
for thisMessageFmt.ChoiceArgumentSegment
option.double
getLimit()
Get the limit for thisMessageFmt.ChoiceArgumentSegment
option.Get the limit for thisMessageFmt.ChoiceArgumentSegment
option in string form.int
hashCode()
void
setFormat
(MessageFmt format) void
setLimit
(double limit) void
setLimitDescription
(String limitDescription) Set the limit for thisMessageFmt.ChoiceArgumentSegment
option in string form.toString()
-
Constructor Details
-
Option
public Option() -
Option
-
-
Method Details
-
getLimit
public double getLimit()Get the limit for thisMessageFmt.ChoiceArgumentSegment
option.- Returns:
- argument upper bound (inclusive) for this option
-
setLimit
public void setLimit(double limit) -
getLimitDescription
Get the limit for thisMessageFmt.ChoiceArgumentSegment
option in string form.This property is just an alternative view of
getLimit()
that uses theChoiceFormat
string syntax, which includes a trailing"<"
or"#"
character.For example, a limit of
1.0
is 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.ChoiceArgumentSegment
option in string form.If there is no trailing
"<"
or"#"
character, then"#"
is assumed.- Parameters:
limitDescription
- string description of limit
-
getFormat
Get theMessageFmt
for thisMessageFmt.ChoiceArgumentSegment
option.Note: whereas the options in a
ChoiceFormat
are format strings, in the context of aMessageFormat
a choice-formatted argument format string is interpreted as a nestedMessageFormat
pattern, therefore this property has typeMessageFmt
instead ofString
.- Returns:
- the
MessageFmt
for this option
-
setFormat
-
equals
-
hashCode
public int hashCode() -
toString
-