22 lines
350 B
Java
22 lines
350 B
Java
|
import java.util.*;
|
||
|
|
||
|
public class File<E>{
|
||
|
|
||
|
private Queue<E> file;
|
||
|
|
||
|
public File(){
|
||
|
this.file = new LinkedList<>();
|
||
|
}
|
||
|
|
||
|
public void enqueue(E valeur){
|
||
|
this.file.offer(valeur);
|
||
|
}
|
||
|
|
||
|
public E dequeue(){
|
||
|
return this.file.poll();
|
||
|
}
|
||
|
|
||
|
public boolean isEmpty(){
|
||
|
return this.file.isEmpty();
|
||
|
}
|
||
|
}
|