<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package myqueue;

/**
 *
 * @author <NAME> <<EMAIL>>
 */
public class Queue implements IQueue {
    private QueueNode first;
    private QueueNode last;
    
    @Override
    public Object dequeue() throws EEmptyQueue {
        if (this.isEmpty()) {
            throw new EEmptyQueue();
        }
        
        Object o = this.first.getValue();
        this.first = this.first.getNext();
        return o;
    }

    @Override
    public void enqueue(Object o) {
        QueueNode enqueued = new QueueNode(o);
        
        if (this.isEmpty()) {
            this.first = enqueued;
        } else if (this.last == null) {
            this.last = enqueued;
            this.first.setNext(this.last);
        } else {
            this.last.setNext(enqueued);<commit_msg>Update Queue.java<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package myqueue;

/**
 *
 * @author <NAME> <<EMAIL>>
 */
public class Queue implements IQueue {
    private QueueNode first;
    private QueueNode last;
    
    @Override
    public Object dequeue() throws EEmptyQueue {
        if (this.isEmpty()) {
            throw new EEmptyQueue();
        }
        
        QueueNode nodeFirst = this.first();
        
        Object o = nodeFirst.getValue();
        this.first = nodeFirst.getNext();
        
        nodeFirst.setNext(null);
        return o;
    }

    @Override
    public void enqueue(Object o) {
        QueueNode enqueued = new QueueNode(o);
        
        if (this.isEmpty()) {
            this.first = enqueued;
        } else if (this.last == null) {
            this.last = enqueued;
            this.first.setNext(this.last);
        } else {
            this.last.setNext(enqueued);
{'fraction_non_alphanumeric': 0.10366748166259168, 'fraction_numerical': 0.0, 'mean_word_length': 1.9912280701754386, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4812920', 'n_tokens_mistral': 583, 'n_tokens_neox': 577, 'n_words': 170}