All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.annot8.common.implementations.pipelines.SimpleItemQueue Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
/* Annot8 (annot8.io) - Licensed under Apache-2.0. */
package io.annot8.common.implementations.pipelines;

import java.util.Deque;
import java.util.concurrent.ConcurrentLinkedDeque;

import io.annot8.core.data.Item;

public class SimpleItemQueue implements ItemQueue {

  private final Deque items = new ConcurrentLinkedDeque<>();

  public void add(Item item) {
    items.push(item);
  }

  public boolean hasItems() {
    return !items.isEmpty();
  }

  public Item next() {
    return items.pop();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy