private void applyEnum(TaskMonitor monitor) throws CancelledException {

		Listing listing = program.getListing();
		InstructionIterator it = listing.getInstructions(addresses, true);
		monitor.initialize(addresses.getNumAddresses());
		while (it.hasNext()) {

			monitor.checkCancelled();

			Instruction instruction = it.next();
			processsEquates(instruction);
			monitor.incrementProgress(instruction.getLength());
		}
	}
Constructor

@param program The program to use
@param addresses The addresses to apply an enum to
@param enoom The enum to apply equates with
@param shouldDoOnSubOps true if the enum should also be applied to the sub-operands.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/equate/CreateEnumEquateCommand.java