@Override
	public boolean applyTo(Program program) {
		EquateTable equateTable = program.getEquateTable();
		equate = equateTable.getEquate(equateName);

		if (existsWithDifferentValue(equate)) {
			msg = "Equate named " + equateName + " already exists with value of " +
				equate.getValue() + ".";
			return false;
		}

		if (equate == null) {
			// Create new equate
			try {
				equate = equateTable.createEquate(equateName, equateValue);
			}
			catch (DuplicateNameException e) {
				msg = "Equate named " + equateName + " already exists";
				return false;
			}
			catch (InvalidInputException e) {
				msg = "Invalid equate name: " + equateName;
				return false;
			}
		}

		// Add reference to existing equate
		equate.addReference(addr, opIndex);
		return true;
	}
Constructor
@param equateName the name of the equate to applied or removed at this location.
@param addr the address of the current location.
@param opIndex the operand index of the current location.
@param equateValue the numeric value at the current location.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/equate/SetEquateCmd.java