Last active
August 27, 2018 05:15
-
-
Save galdosd/fd9949a7a0146ffdde3a16eaa34939ea to your computer and use it in GitHub Desktop.
es
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface State<T_state extends State> { | |
void load(History<T_state> history, int lastTransaction); | |
} | |
public abstract class BaseState<T_state extends State> implements State<T_state> { | |
private int lastTransaction = -1; | |
@Override public void load(History<T_state> history, int lastTransaction) { | |
} | |
} | |
public interface History<T_state extends State> { | |
List<Transaction<T_state>> getTransactions(); | |
} | |
public interface Transaction<T_state extends State> { | |
List<Change<T_state>> getChanges(); | |
} | |
public interface Change<T_state extends State>{ | |
Change<T_state> apply(T_state s); | |
void unapply(T_state s); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment