Package java.util

Examples of java.util.NoSuchElementException


         * @return an <code>Object</code> value
         * @exception NoSuchElementException if there is no next element
         */
        public final T next() {
            if (_nextIndex == _size) {
                throw new NoSuchElementException();
            }

            _lastReturned = _next;
            _next = (T) _next.getNext();
            _nextIndex++;
View Full Code Here


         * @return an <code>Object</code> value
         * @exception NoSuchElementException if there is no previous element.
         */
        public final T previous() {
            if (_nextIndex == 0) {
                throw new NoSuchElementException();
            }

            if (_nextIndex == _size) {
                _lastReturned = _next = _lastElement;
            } else {
View Full Code Here

   * @param scname  service class name.
   */
  static void start(String scname) throws Exception {
    ServiceDesc desc = (ServiceDesc) manager.registry.get(scname);
    if (desc == null)
      throw new NoSuchElementException("Unknown service: " + scname);
    start(desc);
  }
View Full Code Here

   * @param scname  service class name.
   */
  public static void stop(String scname) throws Exception {
    ServiceDesc desc = (ServiceDesc) manager.registry.get(scname);
    if (desc == null)
      throw new NoSuchElementException("Unknown service: " + scname);
    stop(desc);
  }
View Full Code Here

     * @throws NoSuchElementException if this deque is empty
     */
    public E removeFirst() {
        E x = pollFirst();
        if(x == null)
            throw new NoSuchElementException();
        return x;
    }
View Full Code Here

     * @throws NoSuchElementException if this deque is empty
     */
    public E removeLast() {
        E x = pollLast();
        if(x == null)
            throw new NoSuchElementException();
        return x;
    }
View Full Code Here

     * @throws NoSuchElementException if this deque is empty
     */
    public E getFirst() {
        E x = elements[head];
        if(x == null)
            throw new NoSuchElementException();
        return x;
    }
View Full Code Here

     * @throws NoSuchElementException if this deque is empty
     */
    public E getLast() {
        E x = elements[(tail - 1) & (elements.length - 1)];
        if(x == null)
            throw new NoSuchElementException();
        return x;
    }
View Full Code Here

        }

        public E next() {
            E result;
            if(cursor == fence)
                throw new NoSuchElementException();
            // This check doesn't catch all possible comodifications,
            // but does catch the ones that corrupt traversal
            if(tail != fence || (result = elements[cursor]) == null)
                throw new ConcurrentModificationException();
            lastRet = cursor;
View Full Code Here

            return cursor != fence;
        }

        public E next() {
            if(cursor == fence)
                throw new NoSuchElementException();
            cursor = (cursor - 1) & (elements.length - 1);
            E result = elements[cursor];
            if(head != fence || result == null)
                throw new ConcurrentModificationException();
            lastRet = cursor;
View Full Code Here

TOP

Related Classes of java.util.NoSuchElementException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.