Java 类com.intellij.openapi.util.AtomicNullableLazyValue 实例源码

项目:intellij-ce-playground    文件:ClsTypeElementImpl.java   
public ClsTypeElementImpl(@NotNull PsiElement parent, @NotNull String typeText, char variance) {
  myParent = parent;
  myTypeText = TypeInfo.internFrequentType(typeText);
  myVariance = variance;
  myChild = new AtomicNullableLazyValue<ClsElementImpl>() {
    @Override
    protected ClsElementImpl compute() {
      return calculateChild();
    }
  };
  myCachedType = new AtomicNotNullLazyValue<PsiType>() {
    @NotNull
    @Override
    protected PsiType compute() {
      return calculateType();
    }
  };
}
项目:consulo-java    文件:ClsPackageAccessibilityStatementImpl.java   
public ClsPackageAccessibilityStatementImpl(PsiPackageAccessibilityStatementStub stub)
{
    super(stub);
    myPackageReference = new AtomicNullableLazyValue<PsiJavaCodeReferenceElement>()
    {
        @Override
        protected PsiJavaCodeReferenceElement compute()
        {
            String packageName = getPackageName();
            return packageName != null ? new ClsJavaCodeReferenceElementImpl(ClsPackageAccessibilityStatementImpl.this, packageName) : null;
        }
    };
    myModuleReferences = new AtomicNotNullLazyValue<Iterable<PsiJavaModuleReferenceElement>>()
    {
        @NotNull
        @Override
        protected Iterable<PsiJavaModuleReferenceElement> compute()
        {
            return ContainerUtil.map(getStub().getTargets(), target -> new ClsJavaModuleReferenceElementImpl(ClsPackageAccessibilityStatementImpl.this, target));
        }
    };
}
项目:consulo-java    文件:ClsTypeElementImpl.java   
public ClsTypeElementImpl(@NotNull PsiElement parent, @NotNull String typeText, char variance)
{
    myParent = parent;
    myTypeText = TypeInfo.internFrequentType(typeText);
    myVariance = variance;
    myChild = new AtomicNullableLazyValue<ClsElementImpl>()
    {
        @Override
        protected ClsElementImpl compute()
        {
            return calculateChild();
        }
    };
    myCachedType = new AtomicNotNullLazyValue<PsiType>()
    {
        @NotNull
        @Override
        protected PsiType compute()
        {
            return calculateType();
        }
    };
}