Queue

Download

Download jar file or use maven. psjava requires Java 1.6 (or above)

<dependency>
    <groupId>org.psjava</groupId>
    <artifactId>psjava</artifactId>
    <version>0.1.19</version>
</dependency>

Example Code

Queue<String> queue = GoodQueueFactory.getInstance().create();

queue.enque("A");
queue.enque("B");

// Here are operations.

String dequed1 = queue.deque(); // must be "A"
String dequed2 = queue.deque(); // must be "B"
boolean empty = queue.isEmpty(); // must be true

Implementation


Copyright 2014 psjava team. View on GitHub