Programmieren_Projekt/logging/LogElementList.java

56 lines
873 B
Java

package logging;
import java.util.Vector;
public final class LogElementList<LOG extends LogElement> extends Vector<LOG> {
private int actual;
private boolean initialized;
public LogElementList() {
super();
actual = -1;
initialized = false;
}
public LOG get() {
return get(actual);
}
public boolean isInitialized() {
return initialized;
}
public void clear() {
super.clear();
actual = -1;
initialized = false;
}
public void prev() {
if (actual > 0) {
actual--;
} else {
actual = 0;
}
initialized = true;
}
public void next() {
if (actual < size() - 1) {
actual++;
} else {
actual = size() - 1;
}
initialized = true;
}
public void first() {
actual = 0;
initialized = true;
}
public void last() {
actual = size() - 1;
initialized = true;
}
}