42 lines
762 B
Java
42 lines
762 B
Java
package dblog;
|
|
|
|
/**
|
|
* Description: des
|
|
* Author: zsx
|
|
* CreateDate: 2020/4/16 20:54
|
|
*/
|
|
|
|
import java.util.List;
|
|
|
|
public class LogList<E> extends WrapList<E> {
|
|
|
|
private Runnable verify;
|
|
|
|
LogList<E> setVerify(Runnable verify) {
|
|
this.verify = verify;
|
|
return this;
|
|
}
|
|
|
|
protected final void beforeChange() {
|
|
if (this.verify != null) {
|
|
this.verify.run();
|
|
}
|
|
|
|
}
|
|
|
|
protected void afterAdd(E add) {
|
|
}
|
|
|
|
protected void beforeRemove(E remove) {
|
|
}
|
|
|
|
public List<E> subList(int fromIndex, int toIndex) {
|
|
return new WrapList(this, this.getWrapped().subList(fromIndex, toIndex));
|
|
}
|
|
|
|
public LogList(List<E> wrapped) {
|
|
super((LogList)null, wrapped);
|
|
}
|
|
|
|
}
|