strangedb/src/main/java/org/warp/jcwdb/LightList.java

30 lines
724 B
Java
Raw Normal View History

2018-11-21 01:02:25 +01:00
package org.warp.jcwdb;
2018-12-20 00:16:16 +01:00
import java.util.Iterator;
import java.util.List;
2018-12-19 12:19:03 +01:00
import java.util.function.Consumer;
2019-01-09 19:05:41 +01:00
import java.util.function.Supplier;
2018-12-04 23:57:49 +01:00
2018-12-20 00:16:16 +01:00
public interface LightList<T> extends List<T> {
2018-11-21 01:02:25 +01:00
2018-12-20 00:16:16 +01:00
Iterator<EntryReference<T>> iteratorReferences();
2018-11-21 01:02:25 +01:00
2018-12-20 00:16:16 +01:00
void forEachReference(Consumer<? super EntryReference<T>> action);
2018-11-21 01:02:25 +01:00
2018-12-20 00:16:16 +01:00
EntryReference<T> addEntry(T o);
2018-11-21 01:02:25 +01:00
2019-01-09 19:05:41 +01:00
EntryReference<T> set(int setOffset, final EntryReference<T> element);
2018-12-20 00:16:16 +01:00
boolean remove(EntryReference<T> ref);
2018-11-21 01:02:25 +01:00
2018-12-20 00:16:16 +01:00
EntryReference<T> getReference(int index);
2018-11-21 01:02:25 +01:00
2019-01-09 19:05:41 +01:00
EntryReference<T> getReferenceOrInitialize(int index, Supplier<T> initializer);
2018-12-20 00:16:16 +01:00
int indexOfEntry(EntryReference<T> ref);
2018-11-21 01:02:25 +01:00
2018-12-20 00:16:16 +01:00
int lastIndexOfEntry(EntryReference<T> ref);
2018-12-19 12:19:03 +01:00
2018-12-20 00:16:16 +01:00
void appendIndex(long elementIndex);
2018-11-21 01:02:25 +01:00
}