edu.stanford.smi.protege.server.util.FifoReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protege Show documentation
Show all versions of protege Show documentation
Core code for the Protege ontology editor. Serves as the basis for the Protege-Frames and Protege-OWL editors.
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