org.jetlang.core.MessageBuffer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jetlang Show documentation
Show all versions of jetlang Show documentation
Jetlang provides a high performance java threading library. It is a complement to the java.util.concurrent
package introduced in 1.5 and should be used for message based concurrency similar to event based actors in
Scala.
package org.jetlang.core;
import java.util.ArrayList;
/**
* User: mrettig
* Date: Sep 28, 2009
*/
public class MessageBuffer implements MessageReader {
private ArrayList events = new ArrayList<>();
public int size() {
return events.size();
}
public T get(int index) {
return events.get(index);
}
public void add(T r) {
events.add(r);
}
public boolean isEmpty() {
return events.isEmpty();
}
public void clear() {
events.clear();
}
}