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.ArgTypegetArgType()doublegetOffset()List<MessagePatternUtil.VariantNode>getVariants()MessagePatternUtil.VariantNodegetVariantsByType(List<MessagePatternUtil.VariantNode> numericVariants, List<MessagePatternUtil.VariantNode> keywordVariants)Separates the variants by type.booleanhasExplicitOffset()StringtoString()Returns a string containing a concise, human-readable description of this object.
-
-
-
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 List<MessagePatternUtil.VariantNode> getVariants()
- Returns:
- the list of variants: the nested messages with their selection criteria
-
getVariantsByType
public MessagePatternUtil.VariantNode getVariantsByType(List<MessagePatternUtil.VariantNode> numericVariants, 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 String toString()
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toStringmethod if you intend implementing your owntoStringmethod.
-
-