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

edu.stanford.smi.protege.server.util.FifoReader Maven / Gradle / Ivy

Go to download

Core code for the Protege ontology editor. Serves as the basis for the Protege-Frames and Protege-OWL editors.

There is a newer version: 3.5.1
Show newest version
package edu.stanford.smi.protege.server.util;

public class FifoReader {
  private LinkedList queue;
  private FifoWriter writer;

  public FifoReader(FifoWriter writer) {
    this.writer = writer;
    queue = writer.getQueue();
  }
  
  public FifoReader(FifoReader fr) {
    queue = fr.queue;
    writer = fr.writer;
  }
  
  public X read() {
    synchronized (writer) {
      if (queue.next() == null) {
        return null;
      }
      X x = queue.element();
      queue = queue.next();
      return x;
    }
  }
  
  public int getCounter() {
    return queue.getCounter();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy