/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ghidra.app.plugin.core.scalartable;

import java.util.Objects;

import ghidra.program.model.address.Address;
import ghidra.program.model.listing.CodeUnit;
import ghidra.program.model.scalar.Scalar;

/**
 * Class for the Scalar plugin table that will contain the necessary elements for the table
 */
public class ScalarRowObject {

	private Address address;
	private CodeUnit codeUnit;
	private Scalar scalar;

	ScalarRowObject(CodeUnit codeUnit, Scalar scalar) {
		this.codeUnit = Objects.requireNonNull(codeUnit);
		this.address = codeUnit.getAddress();
		this.scalar = Objects.requireNonNull(scalar);
	}

	public Address getAddress() {
		return address;
	}

	public CodeUnit getCodeUnit() {
		return codeUnit;
	}

	public Scalar getScalar() {
		return scalar;
	}

	@Override
	public String toString() {
		return scalar + " @ " + address;
	}
}
