hudson.plugins.analysis.util
Class TreeStringBuilder

java.lang.Object
  extended by hudson.plugins.analysis.util.TreeStringBuilder

public class TreeStringBuilder
extends Object

Builds TreeStrings 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 TreeStrings that you get back start to share data.

Because the internal state of TreeStrings get mutated as new strings are interned (to exploit new-found common prefixes), TreeStrings 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 TreeStrings until you are done interning strings.

Author:
Kohsuke Kawaguchi

Constructor Summary
TreeStringBuilder()
           
 
Method Summary
 void dedup()
          Further reduces the memory footprint by finding the same labels across multiple TreeStrings.
 TreeString intern(String s)
          Interns a string.
 TreeString intern(TreeString s)
          Interns a TreeString created elsewhere.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeStringBuilder

public TreeStringBuilder()
Method Detail

intern

public TreeString intern(String s)
Interns a string.


intern

public TreeString intern(TreeString s)
Interns a TreeString created elsewhere.


dedup

public void dedup()
Further reduces the memory footprint by finding the same labels across multiple TreeStrings.



Copyright © 2004-2012 Hudson. All Rights Reserved.