Class 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 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
      • 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)