All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.yapbam.data.AbstractTransactionUpdater Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
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