Skip to content

Commit

Permalink
issue #326: exposing the string cache to allow users to tweak it to t…
Browse files Browse the repository at this point in the history
…heir needs.
  • Loading branch information
jbax committed May 14, 2019
1 parent 43bed51 commit 4253339
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -617,4 +617,12 @@ private static boolean shouldBeLiteral(String string, boolean lowercaseIdentifie
}
return false;
}

/**
* Returns the internal string cache to allow users to tweak its size limit or clear it when appropriate
* @return the string cache used to store {@code NormalizedString} instances associated with their original {@code String}.
*/
public StringCache<NormalizedString> getCache(){
return stringCache;
}
}
3 changes: 3 additions & 0 deletions src/main/java/com/univocity/parsers/common/StringCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ public T get(String input) {
return out;
}

/**
* Removes all entries stored in this cache.
*/
public void clear() {
stringCache.clear();
}
Expand Down

0 comments on commit 4253339

Please sign in to comment.