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

org.jruby.ir.instructions.NOperandInstr Maven / Gradle / Ivy

There is a newer version: 9.4.12.0
Show newest version
package org.jruby.ir.instructions;

import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;

/**
 * For Instrs with an arbitrary number of Operands.
 */
public abstract class NOperandInstr extends Instr {
    protected transient Operand[] operands;

    public NOperandInstr(Operation operation, Operand[] operands) {
        super(operation);

        this.operands = operands;
    }

    public Operand[] getOperands() {
        return operands;
    }

    public void setOperand(int i, Operand operand) {
        if (i < 0 || i >= operands.length) {
            throw new IllegalArgumentException("No such operand to set at index: " + i);
        }

        operands[i] = operand;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy