Tabnine Logo
NoSuchElementException
Code IndexAdd Tabnine to your IDE (free)

How to use
NoSuchElementException
in
java.util

Best Java code snippets using java.util.NoSuchElementException (Showing top 20 results out of 38,241)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: ReactiveX/RxJava

  @Override
  public NoSuchElementException call() throws Exception {
    return new NoSuchElementException();
  }
}
origin: google/guava

 @Override
 public T next() {
  if (done) {
   throw new NoSuchElementException();
  }
  done = true;
  return value;
 }
};
origin: google/guava

@Override
public Range<C> range() {
 throw new NoSuchElementException();
}
origin: google/guava

@Override
public C first() {
 throw new NoSuchElementException();
}
origin: google/guava

@Override
public Range<C> range(BoundType lowerBoundType, BoundType upperBoundType) {
 throw new NoSuchElementException();
}
origin: google/guava

@Override
public Object next() {
 throw new NoSuchElementException();
}
origin: google/guava

@Override
public C last() {
 throw new NoSuchElementException();
}
origin: google/guava

@Override
public Range span() {
 throw new NoSuchElementException();
}
origin: libgdx/libgdx

public JsonValue next () {
  current = entry;
  if (current == null) throw new NoSuchElementException();
  entry = current.next;
  return current;
}
origin: libgdx/libgdx

/** Returns the first (head) item in the queue (without removing it).
 * @see #addFirst(Object)
 * @see #removeFirst()
 * @throws NoSuchElementException when queue is empty */
public T first () {
  if (size == 0) {
    // Underflow
    throw new NoSuchElementException("Queue is empty.");
  }
  return values[head];
}
origin: square/retrofit

private static int indexOf(Object[] array, Object toFind) {
 for (int i = 0; i < array.length; i++) {
  if (toFind.equals(array[i])) return i;
 }
 throw new NoSuchElementException();
}
origin: google/guava

/**
 * Returns the url identifying the resource.
 *
 * <p>See {@link ClassLoader#getResource}
 *
 * @throws NoSuchElementException if the resource cannot be loaded through the class loader,
 *     despite physically existing in the class path.
 */
public final URL url() {
 URL url = loader.getResource(resourceName);
 if (url == null) {
  throw new NoSuchElementException(resourceName);
 }
 return url;
}
origin: google/guava

 @Override
 public E next() {
  int index = Integer.numberOfTrailingZeros(remainingSetBits);
  if (index == 32) {
   throw new NoSuchElementException();
  }
  remainingSetBits &= ~(1 << index);
  return elements.get(index);
 }
};
origin: spring-projects/spring-framework

@Override
public E next() {
  this.inUse = true;
  for (Iterator<E> iterator : this.iterators) {
    if (iterator.hasNext()) {
      return iterator.next();
    }
  }
  throw new NoSuchElementException("All iterators exhausted");
}
origin: google/guava

@Override
public T next() {
 if (!iterator.hasNext()) {
  iterator = iterable.iterator();
  if (!iterator.hasNext()) {
   throw new NoSuchElementException();
  }
 }
 return iterator.next();
}
origin: ReactiveX/RxJava

  @Override
  public void onComplete() {
    downstream.onError(new NoSuchElementException());
  }
}
origin: ReactiveX/RxJava

@Override
public Long next() {
  long c = count;
  if (c != end) {
    count = c + 1;
    return c;
  }
  throw new NoSuchElementException();
}
origin: square/okhttp

@Override public Snapshot next() {
 if (!hasNext()) throw new NoSuchElementException();
 removeSnapshot = nextSnapshot;
 nextSnapshot = null;
 return removeSnapshot;
}
origin: square/okhttp

@Override public String next() {
 if (!hasNext()) throw new NoSuchElementException();
 String result = nextUrl;
 nextUrl = null;
 canRemove = true;
 return result;
}
origin: google/guava

 Object getElement() {
  if (element == null) {
   throw new NoSuchElementException();
  } else if (extras == null) {
   return element;
  } else {
   throw multiples(false);
  }
 }
}
java.utilNoSuchElementException

Javadoc

Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.

Most used methods

  • <init>
    Constructs a NoSuchElementException, saving a reference to the error message string s for later retr
  • getMessage
  • initCause
  • printStackTrace
  • toString
  • getLocalizedMessage
  • getCause
  • getStackTrace
  • setStackTrace
  • addSuppressed

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now