Java 类com.intellij.util.containers.LimitedPool 实例源码

项目:intellij-ce-playground    文件:PsiBuilderImpl.java   
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;
}
项目:tools-idea    文件:PsiBuilderImpl.java   
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;
}
项目:consulo    文件:PsiBuilderImpl.java   
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;
}