net.sf.freecol.client.gui.i18n
Class Number

java.lang.Object
  extended by net.sf.freecol.client.gui.i18n.Number
All Implemented Interfaces:
Selector
Direct Known Subclasses:
DefaultNumberRule, DualNumberRule, OtherNumberRule, PluralNumberRule, ZeroOneNumberRule

public abstract class Number
extends java.lang.Object
implements Selector

Classes implementing this interface can determine the category and the index of a double based on the number rules for a language. See the Common Locale Data Repository.


Nested Class Summary
static class Number.Category
           
 
Field Summary
private static java.util.logging.Logger logger
           
 
Constructor Summary
Number()
           
 
Method Summary
abstract  Number.Category getCategory(double selector)
          Return the category the selector value belongs to.
 java.lang.String getKey(double selector)
          Return the key of the rule this selector matches.
 java.lang.String getKey(java.lang.String selector, java.lang.String template)
          Transform the given string selector into a replacement key for a choice format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger
Constructor Detail

Number

public Number()
Method Detail

getCategory

public abstract Number.Category getCategory(double selector)
Return the category the selector value belongs to.

Parameters:
selector - a double value
Returns:
a Category value

getKey

public java.lang.String getKey(java.lang.String selector,
                               java.lang.String template)
Transform the given string selector into a replacement key for a choice format.

Specified by:
getKey in interface Selector
Parameters:
selector - a String value
template - the String template that contains the selector (only used for error reporting)
Returns:
a String value

getKey

public java.lang.String getKey(double selector)
Return the key of the rule this selector matches. The key is the string representation of the Category.

Parameters:
selector - a double value
Returns:
a String value