java.lang.Object
com.intellij.psi.tree.TokenSet
A set of element types.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull TokenSetReturns a token set containing a result of "set subtraction" of set B from set A.static @NotNull TokenSetReturns a token set containing the intersection of the specified token sets.booleancontains(@Nullable IElementType t) Checks if the specified element type is contained in the set.static @NotNull TokenSetcreate(IElementType @NotNull ... types) Returns a new token set containing the specified element types.static TokenSetforAllMatching(IElementType.Predicate condition) IElementType @NotNull []getTypes()Returns the array of element types contained in the set.static @NotNull TokenSetReturns a token set containing the union of the specified token sets.toString()
-
Field Details
-
EMPTY
-
ANY
-
WHITE_SPACE
-
-
Method Details
-
contains
Checks if the specified element type is contained in the set.- Parameters:
t- the element type to search for.- Returns:
- true if the element type is found in the set, false otherwise.
-
getTypes
Returns the array of element types contained in the set.- Returns:
- the contents of the set.
-
toString
-
create
Returns a new token set containing the specified element types.- Parameters:
types- the element types contained in the set.- Returns:
- the new token set.
-
forAllMatching
- Returns:
- a token set containing all element types satisfying the given condition, including ones registered after this set creation
-
orSet
Returns a token set containing the union of the specified token sets.- Parameters:
sets- the token sets to unite.- Returns:
- the new token set.
-
andSet
@NotNull public static @NotNull TokenSet andSet(@NotNull @NotNull TokenSet a, @NotNull @NotNull TokenSet b) Returns a token set containing the intersection of the specified token sets.- Parameters:
a- the first token set to intersect.b- the second token set to intersect.- Returns:
- the new token set.
-
andNot
@NotNull public static @NotNull TokenSet andNot(@NotNull @NotNull TokenSet a, @NotNull @NotNull TokenSet b) Returns a token set containing a result of "set subtraction" of set B from set A.- Parameters:
a- the basic token set.b- the token set to subtract.- Returns:
- the new token set.
-