com.ibm.icu.text
Class MessagePatternUtil.ComplexArgStyleNode

java.lang.Object
  extended by com.ibm.icu.text.MessagePatternUtil.Node
      extended by 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.)

Status:
Draft ICU 49.

Method Summary
 MessagePattern.ArgType getArgType()
           
 double getOffset()
           
 List<MessagePatternUtil.VariantNode> getVariants()
           
 MessagePatternUtil.VariantNode getVariantsByType(List<MessagePatternUtil.VariantNode> numericVariants, List<MessagePatternUtil.VariantNode> keywordVariants)
          Separates the variants by type.
 boolean hasExplicitOffset()
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getArgType

public MessagePattern.ArgType getArgType()
Returns:
the argument type (same as getArgType() on the parent ArgNode)
Status:
Draft ICU 49.

hasExplicitOffset

public boolean hasExplicitOffset()
Returns:
true if this is a plural style with an explicit offset
Status:
Draft ICU 49.

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
Status:
Draft ICU 49.

getVariants

public List<MessagePatternUtil.VariantNode> getVariants()
Returns:
the list of variants: the nested messages with their selection criteria
Status:
Draft ICU 49.

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)
Status:
Draft ICU 49.

toString

public String toString()

Overrides:
toString in class Object
Status:
Draft ICU 49.


Copyright (c) 2012 IBM Corporation and others.