Codota Logo
SmartList.<init>
Code IndexAdd Codota to your IDE (free)

How to use
com.intellij.util.SmartList
constructor

Best Java code snippets using com.intellij.util.SmartList.<init> (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: go-lang-plugin-org/go-lang-idea-plugin

@NotNull
public static <T extends PsiElement> List<T> getStubChildrenOfTypeAsList(@Nullable PsiElement element, @NotNull Class<T> aClass) {
 if (element == null) return Collections.emptyList();
 StubElement<?> stub = element instanceof StubBasedPsiElement ? ((StubBasedPsiElement)element).getStub() : null;
 if (stub == null) {
  return getChildrenOfTypeAsList(element, aClass);
 }
 List<T> result = new SmartList<T>();
 for (StubElement childStub : stub.getChildrenStubs()) {
  PsiElement child = childStub.getPsi();
  if (aClass.isInstance(child)) {
   //noinspection unchecked
   result.add((T)child);
  }
 }
 return result;
}
origin: JetBrains/jediterm

void addChild(@NotNull ObjectNode<T> child) {
 List<ObjectNode<T>> children = myChildren;
 if (children == null) {
  myChildren = new SmartList<ObjectNode<T>>(child);
 }
 else {
  children.add(child);
 }
 child.myParent = this;
}
origin: JetBrains/jediterm

@NotNull
@Contract(pure=true)
public static <T> List<T> newSmartList(@NotNull T... elements) {
 return new SmartList<T>(elements);
}
origin: JetBrains/jediterm

@NotNull
@Contract(pure=true)
public static <T, V> List<V> findAll(@NotNull Collection<? extends T> collection, @NotNull Class<V> instanceOf) {
 final List<V> result = new SmartList<V>();
 for (final T t : collection) {
  if (instanceOf.isInstance(t)) {
   @SuppressWarnings("unchecked") V v = (V)t;
   result.add(v);
  }
 }
 return result;
}
origin: JetBrains/jediterm

@NotNull
@Contract(pure=true)
public static <T> List<T> newSmartList() {
 return new SmartList<T>();
}
origin: JetBrains/jediterm

@NotNull
@Contract(pure=true)
public static <T> List<T> newSmartList(T element) {
 return new SmartList<T>(element);
}
origin: JetBrains/jediterm

@NotNull
@Contract(pure=true)
public static <T> List<T> findAll(@NotNull T[] collection, @NotNull Condition<? super T> condition) {
 final List<T> result = new SmartList<T>();
 for (T t : collection) {
  if (condition.value(t)) {
   result.add(t);
  }
 }
 return result;
}
origin: com.github.adedayo.intellij.sdk/java-psi-api

@NotNull
public static PsiClass[] filterByName(@NotNull String className, @NotNull PsiClass[] classes) {
 if (classes.length == 0) return PsiClass.EMPTY_ARRAY;
 if (classes.length == 1) {
  return className.equals(classes[0].getName()) ? classes : PsiClass.EMPTY_ARRAY;
 }
 List<PsiClass> foundClasses = new SmartList<PsiClass>();
 for (PsiClass psiClass : classes) {
  if (className.equals(psiClass.getName())) {
   foundClasses.add(psiClass);
  }
 }
 return foundClasses.isEmpty() ? PsiClass.EMPTY_ARRAY : foundClasses.toArray(new PsiClass[foundClasses.size()]);
}
origin: Non-Dairy-Soy-Plugin/Non-Dairy-Soy-Plugin

@Override
public ProblemDescriptor[] checkFile(@NotNull PsiFile file,
                   @NotNull InspectionManager manager,
                   boolean isOnTheFly) {
  if (!(file instanceof SoyFile) || file.getVirtualFile() == null) {
    return null;
  }
  List<ProblemDescriptor> problems = new SmartList<ProblemDescriptor>();
  findProblems((SoyFile)file, manager, isOnTheFly, problems);
  if (problems.isEmpty()) {
    return ProblemDescriptor.EMPTY_ARRAY;
  }
  return problems.toArray(new ProblemDescriptor[problems.size()]);
}
origin: JetBrains/jediterm

@NotNull
@Contract(pure=true)
public static <T> List<T> findAll(@NotNull Collection<? extends T> collection, @NotNull Condition<? super T> condition) {
 if (collection.isEmpty()) return emptyList();
 final List<T> result = new SmartList<T>();
 for (final T t : collection) {
  if (condition.value(t)) {
   result.add(t);
  }
 }
 return result;
}
origin: JetBrains/jediterm

void doWhenExecuted(@NotNull final Runnable runnable) {
 Runnable toRun;
 synchronized (this) {
  if (isExecuted()) {
   if (myRunnables == null) {
    toRun = runnable;
   }
   else {
    CompositeRunnable composite = new CompositeRunnable(myRunnables);
    composite.add(runnable);
    toRun = composite;
    myRunnables = null;
   }
  }
  else {
   if (myRunnables == null) {
    myRunnables = new SmartList<Runnable>();
   }
   myRunnables.add(runnable);
   return;
  }
 }
 toRun.run();
}
origin: AlexanderBartash/hybris-integration-intellij-idea-plugin

List<FoldingDescriptor> results = new SmartList<>();
jspFile.accept(new XmlRecursiveElementVisitor(true) {
origin: AlexanderBartash/hybris-integration-intellij-idea-plugin

@Nullable
private static IProperty getResolvedProperty(@NotNull final XmlAttributeValue codeValue) {
  return CachedValuesManager.getCachedValue(codeValue, KEY, () -> {
    List<IProperty> allProperties = new SmartList<>();
    for (PsiReference nextRef : codeValue.getReferences()) {
      if (nextRef instanceof PsiPolyVariantReference) {
        Arrays.stream(((PsiPolyVariantReference) nextRef).multiResolve(false))
           .filter(ResolveResult::isValidResult)
           .map(ResolveResult::getElement)
           .map(o -> ObjectUtils.tryCast(o, IProperty.class))
           .filter(Objects::nonNull)
           .forEach(allProperties::add);
      } else {
        Optional.ofNullable(nextRef.resolve())
            .map(o -> ObjectUtils.tryCast(o, IProperty.class))
            .ifPresent(allProperties::add);
      }
    }
    IProperty theChosenOne = chooseForLocale(allProperties);
    return new CachedValueProvider.Result<>(theChosenOne, PsiModificationTracker.MODIFICATION_COUNT);
  });
}
origin: JetBrains/jediterm

@TestOnly
public void flush() {
  List<Pair<Request, Runnable>> requests;
  synchronized (LOCK) {
    if (myRequests.isEmpty()) {
      return;
    }
    requests = new SmartList<>();
    for (Request request : myRequests) {
      Runnable existingTask = request.cancel();
      if (existingTask != null) {
        requests.add(Pair.create(request, existingTask));
      }
    }
    myRequests.clear();
  }
  for (Pair<Request, Runnable> request : requests) {
    synchronized (LOCK) {
      request.first.myTask = request.second;
    }
    request.first.run();
  }
  UIUtil.dispatchAllInvocationEvents();
}
origin: JetBrains/Grammar-Kit

List<Pattern> otherPatterns = new SmartList<>();
if (knownAttribute != null && !(knownAttribute.getDefaultValue() instanceof KnownAttribute.ListValue)) {
 for (BnfAttr attr : thisAttrs.getAttrList()) {
com.intellij.utilSmartList<init>

Popular methods of SmartList

  • add

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • String (java.lang)
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now