de.schlichtherle.util.regex
Class ThreadLocalMatcher
java.lang.Object
java.lang.ThreadLocal
de.schlichtherle.util.regex.ThreadLocalMatcher
public class ThreadLocalMatcher
- extends ThreadLocal
A thread local Matcher
.
This class is intended to be used in multithreaded environments for high
performance pattern matching.
- Since:
- TrueZIP 6.5 (refactored from inner class in
de.schlichtherle.io.DefaultArchiveDetector)
- Version:
- TrueZIP 6.7
- See Also:
reset(CharSequence)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadLocalMatcher
public ThreadLocalMatcher(String regex)
throws PatternSyntaxException
- Creates a new thread local matcher by compiling the given regex.
- Parameters:
regex
- The expression to be compiled.
- Throws:
PatternSyntaxException
- If the expression's syntax is invalid.
ThreadLocalMatcher
public ThreadLocalMatcher(Pattern pattern)
- Creates a new thread local matcher by using the given pattern.
- Parameters:
pattern
- The pattern to be used.
- Throws:
NullPointerException
- If the parameter is null
.
initialValue
protected Object initialValue()
- Overrides:
initialValue
in class ThreadLocal
reset
public Matcher reset(CharSequence input)
- Resets the thread local matcher with the given character sequence and
returns it.