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.)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
-
-
-
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
-
-