Package ch.usi.si.seart.treesitter
Enum Quantifier
- java.lang.Object
-
- java.lang.Enum<Quantifier>
-
- ch.usi.si.seart.treesitter.Quantifier
-
- All Implemented Interfaces:
Serializable,Comparable<Quantifier>
public enum Quantifier extends Enum<Quantifier>
Represents theCapturequantifier in aPattern, i.e. the number of nodes that a capture should contain. Within a query, a capture can have different quantifiers for each pattern.- Since:
- 1.12.0
- Author:
- Ozren Dabić
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ONEThe capture will match exactly one node.ONE_OR_MOREThe capture will match at least one node.ZEROThe capture will not match any nodes, as said capture is not present in a specific pattern.ZERO_OR_MOREThe capture will match any number of nodes.ZERO_OR_ONEThe capture will match at most one node.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static QuantifiervalueOf(String name)Returns the enum constant of this type with the specified name.static Quantifier[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ZERO
public static final Quantifier ZERO
The capture will not match any nodes, as said capture is not present in a specific pattern.
-
ZERO_OR_ONE
public static final Quantifier ZERO_OR_ONE
The capture will match at most one node. Example:((_)? @capture)
-
ZERO_OR_MORE
public static final Quantifier ZERO_OR_MORE
The capture will match any number of nodes. Example:((_)* @capture)
-
ONE
public static final Quantifier ONE
The capture will match exactly one node. Example:((_) @capture)
-
ONE_OR_MORE
public static final Quantifier ONE_OR_MORE
The capture will match at least one node. Example:((_)+ @capture)
-
-
Method Detail
-
values
public static Quantifier[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Quantifier c : Quantifier.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Quantifier valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
-