MCPcopy Index your code
hub / github.com/processing/processing / matchPattern

Method matchPattern

core/src/processing/core/PApplet.java:9254–9272  ·  view source on GitHub ↗
(String regexp)

Source from the content-addressed store, hash-verified

9252 static protected LinkedHashMap<String, Pattern> matchPatterns;
9253
9254 static Pattern matchPattern(String regexp) {
9255 Pattern p = null;
9256 if (matchPatterns == null) {
9257 matchPatterns = new LinkedHashMap<String, Pattern>(16, 0.75f, true) {
9258 @Override
9259 protected boolean removeEldestEntry(Map.Entry<String, Pattern> eldest) {
9260 // Limit the number of match patterns at 10 most recently used
9261 return size() == 10;
9262 }
9263 };
9264 } else {
9265 p = matchPatterns.get(regexp);
9266 }
9267 if (p == null) {
9268 p = Pattern.compile(regexp, Pattern.MULTILINE | Pattern.DOTALL);
9269 matchPatterns.put(regexp, p);
9270 }
9271 return p;
9272 }
9273
9274
9275 /**

Callers 2

matchMethod · 0.95
matchAllMethod · 0.95

Calls 3

getMethod · 0.65
compileMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected