Package org.apache.commons.collections

Examples of org.apache.commons.collections.BufferUnderflowException


   * @throws BufferUnderflowException
   *             if the buffer is empty
   */
  public Object get() {
    if (isEmpty()) {
      throw new BufferUnderflowException("The buffer is already empty");
    }

    return elements[start];
  }
View Full Code Here


   * @throws BufferUnderflowException
   *             if the buffer is empty
   */
  public Object remove() {
    if (isEmpty()) {
      throw new BufferUnderflowException("The buffer is already empty");
    }

    Object element = elements[start];

    elements[start++] = null;
View Full Code Here

/*  91 */     synchronized (this.lock) {
/*  92 */       while (this.collection.isEmpty()) {
/*     */         try {
/*  94 */           wait();
/*     */         } catch (InterruptedException e) {
/*  96 */           throw new BufferUnderflowException();
/*     */         }
/*     */       }
/*  99 */       return getBuffer().get();
/*     */     }
/*     */   }
View Full Code Here

/* 104 */     synchronized (this.lock) {
/* 105 */       while (this.collection.isEmpty()) {
/*     */         try {
/* 107 */           wait();
/*     */         } catch (InterruptedException e) {
/* 109 */           throw new BufferUnderflowException();
/*     */         }
/*     */       }
/* 112 */       return getBuffer().remove();
/*     */     }
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   public Object get()
/*     */   {
/* 240 */     if (isEmpty()) {
/* 241 */       throw new BufferUnderflowException("The buffer is already empty");
/*     */     }
/*     */
/* 244 */     return this.elements[this.start];
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   public Object remove()
/*     */   {
/* 254 */     if (isEmpty()) {
/* 255 */       throw new BufferUnderflowException("The buffer is already empty");
/*     */     }
/*     */
/* 258 */     Object element = this.elements[this.start];
/*     */
/* 260 */     if (null != element) {
View Full Code Here

/*     */   }
/*     */
/*     */   public Object get()
/*     */   {
/* 208 */     if (isEmpty()) {
/* 209 */       throw new BufferUnderflowException("The buffer is already empty");
/*     */     }
/*     */
/* 212 */     return this.buffer[this.head];
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   public Object remove()
/*     */   {
/* 222 */     if (isEmpty()) {
/* 223 */       throw new BufferUnderflowException("The buffer is already empty");
/*     */     }
/*     */
/* 226 */     Object element = this.buffer[this.head];
/*     */
/* 228 */     if (null != element) {
View Full Code Here

/*     */   }
/*     */
/*     */   public Object get()
/*     */   {
/* 255 */     if (isEmpty()) {
/* 256 */       throw new BufferUnderflowException();
/*     */     }
/* 258 */     return this.elements[1];
/*     */   }
View Full Code Here

    protected static class MyBuffer extends LinkedList implements Buffer {

        public Object get() {
            if( isEmpty() ) {
                throw new BufferUnderflowException();
            }
            return get( 0 );
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.BufferUnderflowException

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.