com.intellij.util.containers.LimitedPool Java Examples
The following examples show how to use
com.intellij.util.containers.LimitedPool.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PsiBuilderImpl.java From consulo with Apache License 2.0 | 5 votes |
public MyTreeStructure(@Nonnull StartMarker root, @Nullable final MyTreeStructure parentTree) { if (parentTree == null) { myPool = new LimitedPool<>(1000, new LimitedPool.ObjectFactory<Token>() { @Override public void cleanup(@Nonnull final Token token) { token.clean(); } @Nonnull @Override public Token create() { return new TokenNode(); } }); myLazyPool = new LimitedPool<>(200, new LimitedPool.ObjectFactory<LazyParseableToken>() { @Override public void cleanup(@Nonnull final LazyParseableToken token) { token.clean(); } @Nonnull @Override public LazyParseableToken create() { return new LazyParseableToken(); } }); } else { myPool = parentTree.myPool; myLazyPool = parentTree.myLazyPool; } myRoot = root; }