public MyTreeStructure(@NotNull StartMarker root, @Nullable final MyTreeStructure parentTree) { if (parentTree == null) { myPool = new LimitedPool<Token>(1000, new LimitedPool.ObjectFactory<Token>() { @Override public void cleanup(@NotNull final Token token) { token.clean(); } @NotNull @Override public Token create() { return new TokenNode(); } }); myLazyPool = new LimitedPool<LazyParseableToken>(200, new LimitedPool.ObjectFactory<LazyParseableToken>() { @Override public void cleanup(@NotNull final LazyParseableToken token) { token.clean(); } @NotNull @Override public LazyParseableToken create() { return new LazyParseableToken(); } }); } else { myPool = parentTree.myPool; myLazyPool = parentTree.myLazyPool; } myRoot = root; }
public MyTreeStructure(@NotNull StartMarker root, @Nullable final MyTreeStructure parentTree) { if (parentTree == null) { myPool = new LimitedPool<Token>(1000, new LimitedPool.ObjectFactory<Token>() { @Override public void cleanup(final Token token) { token.clean(); } @Override public Token create() { return new TokenNode(); } }); myLazyPool = new LimitedPool<LazyParseableToken>(200, new LimitedPool.ObjectFactory<LazyParseableToken>() { @Override public void cleanup(final LazyParseableToken token) { token.clean(); } @Override public LazyParseableToken create() { return new LazyParseableToken(); } }); } else { myPool = parentTree.myPool; myLazyPool = parentTree.myLazyPool; } myRoot = root; }
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; }