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

org.jruby.compiler.ir.operands.Nil Maven / Gradle / Ivy

There is a newer version: 9.4.9.0
Show newest version
package org.jruby.compiler.ir.operands;

// Records the nil object

import org.jruby.interpreter.InterpreterContext;
import org.jruby.runtime.builtin.IRubyObject;

public class Nil extends Constant {
    public static final Nil NIL = new Nil();

    protected Nil() { }

    @Override
    public String toString() { 
        return "nil";
    }

    @Override
    public Operand fetchCompileTimeArrayElement(int argIndex, boolean getSubArray) { 
        return Nil.NIL;
    }

    @Override
    public Object retrieve(InterpreterContext interp) {
		  if (cachedValue == null)
            cachedValue = interp.getRuntime().getNil();
		  return cachedValue;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy