C# Class NGettext.Plural.AstPluralRule

Represents a plural rule that will evaluate a given number using an abstract syntax tree generated by a plural rule formula parser.
Inheritance: IPluralRule
Datei anzeigen Open project: neris/NGettext Class Usage Examples

Public Methods

Method Description
AstPluralRule ( int numPlurals, Token astRoot ) : System

Initializes a new instance of the Token class with given NumPlurals and abstract syntax tree.

Evaluate ( long number ) : int

Evaluates a number and returns a plural form index.

Protected Methods

Method Description
Evaluate ( Token node, long number ) : long

Method Details

AstPluralRule() public method

Initializes a new instance of the Token class with given NumPlurals and abstract syntax tree.
public AstPluralRule ( int numPlurals, Token astRoot ) : System
numPlurals int
astRoot NGettext.Plural.Ast.Token Abstract syntax tree root.
return System

Evaluate() public method

Evaluates a number and returns a plural form index.
public Evaluate ( long number ) : int
number long Number which needs to be evaluated.
return int

Evaluate() protected method

protected Evaluate ( Token node, long number ) : long
node NGettext.Plural.Ast.Token
number long
return long