认识java中的Queue:

来源:互联网 发布:苹果手机称重软件 编辑:程序博客网 时间:2024/06/01 09:28

认识java中的Queue:
A Queue is a collection for holding elements prior to processing. Besides basic Collection operations, queues provide additional insertion, removal, and inspection operations. The Queue interface follows.

public interface Queue extends Collection {
E element();
boolean offer(E e);
E peek();
E poll();
E remove();
}

It is possible for a Queue implementation to restrict the number of elements that it holds; such queues are known as bounded. Some Queue implementations in java.util.concurrent are bounded, but the implementations in java.util are not.

0 0