
net.yapbam.data.AbstractTransactionUpdater Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yapbam-commons Show documentation
Show all versions of yapbam-commons Show documentation
Commons Yapbam classes used by desktop and Android versions.
package net.yapbam.data;
import java.util.ArrayList;
/**
* This utility class is use to make mass modification on transactions and PeriodicalTransactions.
*/
public abstract class AbstractTransactionUpdater {
protected GlobalData data;
/** Constructor.
* @param data the global data onto make the mass modification.
*/
protected AbstractTransactionUpdater (GlobalData data) {
this.data = data;
}
/** Performs the mass modification.
*/
public final void doIt() {
// For performance concerns, we will remove all transactions that needed to be updated and then
// add all their modified instantiations
// First we build list of removed transactions and added ones.
ArrayList newTransactions = new ArrayList();
ArrayList removedTransactions = new ArrayList();
for (int i=0 ; i newPTransactions = new ArrayList();
ArrayList removedPTransactions = new ArrayList();
for (int i=0 ; iBy default, this method returns null.
* @param transaction The transaction to be modified.
* @return the modified transaction or null if the transaction may remain unchanged.
*/
protected Transaction change(Transaction transaction) {
return null;
}
/** Gets the changed view of a periodical transaction.
*
By default, this method returns null.
* @param transaction The periodical transaction to be modified.
* @return the modified periodical transaction or null if it may remain unchanged.
*/
protected PeriodicalTransaction change(PeriodicalTransaction transaction) {
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy