Package jenkins.util
Class TreeStringBuilder
java.lang.Object
jenkins.util.TreeStringBuilder
Builds
TreeString
s that share common prefixes. Call
intern(String)
and you get the TreeString
that represents
the same string, but as you interns more strings that share the same
prefixes, those TreeString
s that you get back start to share data.
Because the internal state of TreeString
s get mutated as new strings
are interned (to exploit new-found common prefixes), TreeString
s
returned from intern(String)
aren't thread-safe until
TreeStringBuilder
is disposed. That is, you have to make sure other
threads don't see those TreeString
s until you are done interning
strings.
- Since:
- 1.473
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dedup()
Further reduces the memory footprint by finding the same labels across multipleTreeString
s.Interns a string.intern
(TreeString s) Interns aTreeString
created elsewhere.
-
Constructor Details
-
TreeStringBuilder
public TreeStringBuilder()
-
-
Method Details
-
intern
Interns a string. -
intern
Interns aTreeString
created elsewhere. -
dedup
public void dedup()Further reduces the memory footprint by finding the same labels across multipleTreeString
s.
-