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
Afficher le fichier Open project: neris/NGettext Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
Evaluate ( Token node, long number ) : long

Method Details

AstPluralRule() public méthode

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.
Résultat System

Evaluate() public méthode

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

Evaluate() protected méthode

protected Evaluate ( Token node, long number ) : long
node NGettext.Plural.Ast.Token
number long
Résultat long