Code example for Splitter

Methods: split

0
  protected List<String> texts; 
 
  protected ContextReferenceSetResolver(@NotNull F element) { 
    this.element = element; 
    this.project = element.getProject(); 
    this.texts = Lists.newArrayList(SPLITTER.split(getText())); 
  } 
 
  @NotNull 
  public final Optional<? extends PsiElement> resolve(int index) { 
    Optional<K>  startElement = getStartElement(); 
    return startElement.isPresent() ? (texts.size() > 1 ? parseNext(startElement, texts, index) : startElement) : Optional.<PsiElement>absent(); 
  } 
 
  private Optional<K> parseNext(Optional<K> current, List<String> texts, int index) { 
    int ind = 1; 
    while (current.isPresent() && ind <= index) { 
      String text = texts.get(ind); 
      if (text.contains(" ")) { 
        return Optional.absent(); 
Contextual code suggestions in your IDE  Get Codota for Java