Package com.ibm.icu.text
Class MessagePatternUtil.ComplexArgStyleNode
- java.lang.Object
-
- com.ibm.icu.text.MessagePatternUtil.Node
-
- com.ibm.icu.text.MessagePatternUtil.ComplexArgStyleNode
-
- Enclosing class:
- MessagePatternUtil
public static class MessagePatternUtil.ComplexArgStyleNode extends MessagePatternUtil.Node
A Node representing details of the argument style of a complex argument. (Which is a choice/plural/select argument which selects among nested messages.)
-
-
Field Summary
Fields Modifier and Type Field Description private MessagePattern.ArgType
argType
private boolean
explicitOffset
private java.util.List<MessagePatternUtil.VariantNode>
list
private double
offset
-
Constructor Summary
Constructors Modifier Constructor Description private
ComplexArgStyleNode(MessagePattern.ArgType argType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addVariant(MessagePatternUtil.VariantNode variant)
private MessagePatternUtil.ComplexArgStyleNode
freeze()
MessagePattern.ArgType
getArgType()
double
getOffset()
java.util.List<MessagePatternUtil.VariantNode>
getVariants()
MessagePatternUtil.VariantNode
getVariantsByType(java.util.List<MessagePatternUtil.VariantNode> numericVariants, java.util.List<MessagePatternUtil.VariantNode> keywordVariants)
Separates the variants by type.boolean
hasExplicitOffset()
java.lang.String
toString()
-
-
-
Field Detail
-
argType
private MessagePattern.ArgType argType
-
offset
private double offset
-
explicitOffset
private boolean explicitOffset
-
list
private volatile java.util.List<MessagePatternUtil.VariantNode> list
-
-
Constructor Detail
-
ComplexArgStyleNode
private ComplexArgStyleNode(MessagePattern.ArgType argType)
-
-
Method Detail
-
getArgType
public MessagePattern.ArgType getArgType()
- Returns:
- the argument type (same as getArgType() on the parent ArgNode)
-
hasExplicitOffset
public boolean hasExplicitOffset()
- Returns:
- true if this is a plural style with an explicit offset
-
getOffset
public double getOffset()
- Returns:
- the plural offset, or 0 if this is not a plural style or the offset is explicitly or implicitly 0
-
getVariants
public java.util.List<MessagePatternUtil.VariantNode> getVariants()
- Returns:
- the list of variants: the nested messages with their selection criteria
-
getVariantsByType
public MessagePatternUtil.VariantNode getVariantsByType(java.util.List<MessagePatternUtil.VariantNode> numericVariants, java.util.List<MessagePatternUtil.VariantNode> keywordVariants)
Separates the variants by type. Intended for use with plural and select argument styles, not useful for choice argument styles.Both parameters are used only for output, and are first cleared.
- Parameters:
numericVariants
- Variants with numeric-value selectors (if any) are added here. Can be null for a select argument style.keywordVariants
- Variants with keyword selectors, except "other", are added here. For a plural argument, if this list is empty after the call, then all variants except "other" have explicit values and PluralRules need not be called.- Returns:
- the "other" variant (the first one if there are several), null if none (choice style)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
addVariant
private void addVariant(MessagePatternUtil.VariantNode variant)
-
freeze
private MessagePatternUtil.ComplexArgStyleNode freeze()
-
-