Package org.eclipse.jface.text.rules
Class NumberRule
java.lang.Object
org.eclipse.jface.text.rules.NumberRule
- All Implemented Interfaces:
IRule
An implementation of
IRule
detecting a numerical value.
Originally since unknown version, but moved to org.eclipse.text in 3.14- Since:
- 3.14
-
Field Summary
-
Constructor Summary
ConstructorDescriptionNumberRule
(IToken token) Creates a rule which will return the specified token when a numerical sequence is detected. -
Method Summary
Modifier and TypeMethodDescriptionevaluate
(ICharacterScanner scanner) Evaluates the rule by examining the characters available from the provided character scanner.void
setColumnConstraint
(int column) Sets a column constraint for this rule.
-
Field Details
-
UNDEFINED
protected static final int UNDEFINEDInternal setting for the un-initialized column constraint- See Also:
-
fToken
The token to be returned when this rule is successful -
fColumn
protected int fColumnThe column constraint
-
-
Constructor Details
-
NumberRule
Creates a rule which will return the specified token when a numerical sequence is detected.- Parameters:
token
- the token to be returned
-
-
Method Details
-
setColumnConstraint
public void setColumnConstraint(int column) Sets a column constraint for this rule. If set, the rule's token will only be returned if the pattern is detected starting at the specified column. If the column is smaller then 0, the column constraint is considered removed.- Parameters:
column
- the column in which the pattern starts
-
evaluate
Description copied from interface:IRule
Evaluates the rule by examining the characters available from the provided character scanner. The token returned by this rule returnstrue
when callingisUndefined
, if the text that the rule investigated does not match the rule's requirements
-