1 7 package com.sun.corba.se.impl.encoding; 8 9 import java.util.LinkedList ; 10 import java.util.NoSuchElementException ; 11 import java.util.LinkedList ; 12 13 16 public class BufferQueue 18 { 19 private LinkedList list = new LinkedList (); 20 21 public void enqueue(ByteBufferWithInfo item) 22 { 23 list.addLast(item); 24 } 25 26 public ByteBufferWithInfo dequeue() throws NoSuchElementException  27 { 28 return (ByteBufferWithInfo)list.removeFirst(); 29 } 30 31 public int size() 32 { 33 return list.size(); 34 } 35 36 public void push(ByteBufferWithInfo item) 39 { 40 list.addFirst(item); 41 } 42 } 43 | Popular Tags |