Class TokenFilter<T extends JobParameters>
java.lang.Object
io.github.douira.glsl_transformer.transform.LifecycleUserImpl<T>
io.github.douira.glsl_transformer.print.filter.TokenFilter<T>
- All Implemented Interfaces:
LifecycleUser<T>
- Direct Known Subclasses:
ChannelFilter,MultiFilter,NewlineFilter,StringFilter
A token filter is an object that can check if given tokens should be printed
or not.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanisTokenAllowed(Token token) Checks if the token should be printed.static <R extends JobParameters>
TokenFilter<R>join(TokenFilter<R> a, TokenFilter<R> b) Joins two arbitrary token filters into a new filter.voidResets the filter's state.Methods inherited from class io.github.douira.glsl_transformer.transform.LifecycleUserImpl
getPlanner, isInitialized, setInitialized, setPlannerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.douira.glsl_transformer.transform.LifecycleUser
getJobParameters, getLexer, getParser, getRootNode, init, initOnce
-
Constructor Details
-
TokenFilter
public TokenFilter()
-
-
Method Details
-
isTokenAllowed
Checks if the token should be printed.- Parameters:
token- The token to check- Returns:
trueif the given token should be printed
-
resetState
public void resetState()Resets the filter's state. Does nothing by default. -
join
Joins two arbitrary token filters into a new filter. They may be null, regular filters or multi filters and will be joined accordingly. The returned instance is either a or b or a new multi filter containing a, b, or their contents. If a multi filter is generated, the settings from the first multi filter in the parameters are copied.- Type Parameters:
R- The job parameter type- Parameters:
a- A token filter. May benull.b- A token filter. May benull.- Returns:
- The joined token filter
-