Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.jruby.ir.operands;
  
  import org.jruby.Ruby;
  import org.jruby.RubyHash;
 
 import java.util.List;

For argument processing. If an opt arg does not exist we will return this so instrs can reason about non-existent arguments. Since this value can be temporarily stored in a binding, we need it to be an IRubyObject as well. But since it can never really participate in any operation, all calls throw a runtime exception.
 
 public class UndefinedValue extends Operand implements IRubyObject {
     public static final UndefinedValue UNDEFINED = new UndefinedValue();
     
     private UndefinedValue() {}
 
     @Override
     public void addUsedVariables(List<org.jruby.ir.operands.Variablel) { 
         /* Nothing to do */
     }
 
     @Override
     public Operand cloneForInlining(InlinerInfo ii) {
         return this;
     }
 
     @Override
     public boolean canCopyPropagate() {
         return true;
     }
 
     @Override
     public Object retrieve(ThreadContext contextIRubyObject selfDynamicScope currDynScopeObject[] temp) {
         return this;
     }
 
     private RuntimeException undefinedOperation() { 
         return new RuntimeException("IR compiler/interpreter bug: org.jruby.ir.operands.UndefinedValue should not be used as a valid value during execution.");
     }
 
     @Deprecated
     public IRubyObject callSuper(ThreadContext contextIRubyObject[] argsBlock block) { throw undefinedOperation(); }
 
     public IRubyObject callMethod(ThreadContext contextString name) { throw undefinedOperation(); }
     public IRubyObject callMethod(ThreadContext contextString nameIRubyObject arg) { throw undefinedOperation(); }
     public IRubyObject callMethod(ThreadContext contextString nameIRubyObject[] args) { throw undefinedOperation(); }
     public IRubyObject callMethod(ThreadContext contextString nameIRubyObject[] argsBlock block) { throw undefinedOperation(); }
 
     @Deprecated
     public IRubyObject callMethod(ThreadContext contextint methodIndexString name) { throw undefinedOperation(); }
     @Deprecated
     public IRubyObject callMethod(ThreadContext contextint methodIndexString nameIRubyObject arg) { throw undefinedOperation(); }
 
     public IRubyObject checkCallMethod(ThreadContext contextString name) { throw undefinedOperation(); }
 
     public boolean isNil() { throw undefinedOperation(); }
    
    

Returns:
 
     public boolean isTrue() { throw undefinedOperation(); }
    
    
RubyMethod isTaint.

Returns:
boolean
 
     public boolean isTaint() { throw undefinedOperation(); }
    
    
RubyMethod setTaint.

Parameters:
b
 
     public void setTaint(boolean b) { throw undefinedOperation(); }
    
    
Infect this object using the taint of another object

Parameters:
obj
Returns:
 
     public IRubyObject infectBy(IRubyObject obj) { throw undefinedOperation(); }
    
    
RubyMethod isFrozen.

Returns:
boolean
    public boolean isFrozen() { throw undefinedOperation(); }
    
    
RubyMethod setFrozen.

Parameters:
b
    public void setFrozen(boolean b) { throw undefinedOperation(); }

    
RubyMethod isUntrusted.

Returns:
boolean
    public boolean isUntrusted() { throw undefinedOperation(); }

    
RubyMethod setUntrusted.

Parameters:
b
    public void setUntrusted(boolean b) { throw undefinedOperation(); }
    
    

Returns:
    public boolean isImmediate() { throw undefinedOperation(); }
    
    
RubyMethod getRubyClass.

Returns:
    public RubyClass getMetaClass() { throw undefinedOperation(); }
    
    
RubyMethod getSingletonClass.

Returns:
RubyClass
    public RubyClass getSingletonClass() { throw undefinedOperation(); }
    
    
RubyMethod getType.

Returns:
RubyClass
    public RubyClass getType() { throw undefinedOperation(); }
    
    
RubyMethod respondsTo.

Parameters:
string
Returns:
boolean
    public boolean respondsTo(String string) { throw undefinedOperation(); }

    
RubyMethod respondsTo.

Parameters:
string
Returns:
boolean
    public boolean respondsToMissing(String string) { throw undefinedOperation(); }

    
RubyMethod respondsTo.

Parameters:
string
Returns:
boolean
    public boolean respondsToMissing(String stringboolean priv) { throw undefinedOperation(); }
    
    
RubyMethod getRuntime.

Returns:
    public Ruby getRuntime() { throw undefinedOperation(); }
    
    
RubyMethod getJavaClass.

Returns:
Class
    public Class getJavaClass() { throw undefinedOperation(); }
    
    
Convert the object into a symbol name if possible.

Returns:
String the symbol name
    public String asJavaString() { throw undefinedOperation(); }
    
    
rb_obj_as_string

Returns:
    public RubyString asString() { throw undefinedOperation(); }
    
    
Methods which perform to_xxx if the object has such a method

Returns:
    public RubyArray convertToArray() { throw undefinedOperation(); }
    

Returns:
    public RubyHash convertToHash() { throw undefinedOperation(); }    
    

Returns:
    
    public RubyFloat convertToFloat() { throw undefinedOperation(); }
    

Returns:
    public RubyInteger convertToInteger() { throw undefinedOperation(); }
    

Returns:
    @Deprecated
    public RubyInteger convertToInteger(int convertMethodIndexString convertMethod) { throw undefinedOperation(); }
    

Returns:
    public RubyInteger convertToInteger(String convertMethod) { throw undefinedOperation(); }
    

Returns:
    public RubyString convertToString() { throw undefinedOperation(); }
    
    

Returns:
    public IRubyObject anyToString() { throw undefinedOperation(); }
    
    

Returns:
    public IRubyObject checkStringType() { throw undefinedOperation(); }

    

Returns:
    public IRubyObject checkStringType19() { throw undefinedOperation(); }
    
    

Returns:
    public IRubyObject checkArrayType() { throw undefinedOperation(); }

    
Convert the object to the specified Java class, if possible.

Parameters:
cls The target type to which the object should be converted.
    public Object toJava(Class cls) { throw undefinedOperation(); }

    
RubyMethod dup.

Returns:
    public IRubyObject dup() { throw undefinedOperation(); }
    
    
RubyMethod inspect.

Returns:
String
    public IRubyObject inspect() { throw undefinedOperation(); }
    
    
RubyMethod rbClone.

Returns:
IRubyObject
    public IRubyObject rbClone() { throw undefinedOperation(); }

    

Returns:
true if an object is Ruby Module instance (note that it will return false for Ruby Classes). If is_a? semantics is required, use (someObject instanceof RubyModule) instead.
    public boolean isModule() { throw undefinedOperation(); }    
    
    

Returns:
true if an object is Ruby Class instance (note that it will return false for Ruby singleton classes). If is_a? semantics is required, use (someObject instanceof RubyClass/MetaClass) instead.
    public boolean isClass() { throw undefinedOperation(); }
    
    
Our version of Data_Wrap_Struct. This method will just set a private pointer to the object provided. This pointer is transient and will not be accessible from Ruby.

Parameters:
obj the object to wrap
    public void dataWrapStruct(Object obj) { throw undefinedOperation(); }
    
    
Our version of Data_Get_Struct. Returns a wrapped data value if there is one, otherwise returns null.

Returns:
the object wrapped.
    public Object dataGetStruct() { throw undefinedOperation(); }
    public Object dataGetStructChecked() { throw undefinedOperation(); }
    
    

Returns:
    public IRubyObject id() { throw undefinedOperation(); }
    
    
    public IRubyObject op_equal(ThreadContext contextIRubyObject other) { throw undefinedOperation(); }
    public IRubyObject op_eqq(ThreadContext contextIRubyObject other) { throw undefinedOperation(); }
    public boolean eql(IRubyObject other) { throw undefinedOperation(); }
    public void addFinalizer(IRubyObject finalizer) { throw undefinedOperation(); }
    public void removeFinalizers() { throw undefinedOperation(); }
    //
    // COMMON VARIABLE METHODS
    //

    
Returns true if object has any variables, defined as:
  • instance variables
  • class variables
  • constants
  • internal variables, such as those used when marshalling Ranges and Exceptions

Returns:
true if object has any variables, else false
    public boolean hasVariables() { throw undefinedOperation(); }

    

Returns:
the count of all variables (ivar/cvar/constant/internal)
    public int getVariableCount() { throw undefinedOperation(); }
    
    
Sets object's variables to those in the supplied list, removing/replacing any previously defined variables. Applies to all variable types (ivar/cvar/constant/internal).

Parameters:
variables the variables to be set for object
    @Deprecated
    public void syncVariables(List<Variable<Object>> variables) { throw undefinedOperation(); }

    
Sets object's variables to those in the supplied object, removing/replacing any previously defined variables of the same name. Applies to all variable types (ivar/cvar/constant/internal).

Parameters:
source the source object containing the variables to sync
    public void syncVariables(IRubyObject source) { throw undefinedOperation(); }
    
    

Returns:
a list of all variables (ivar/cvar/constant/internal)
    public List<Variable<Object>> getVariableList() { throw undefinedOperation(); }
    //
    // INSTANCE VARIABLE METHODS
    //
    
    //
    // INTERNAL VARIABLE METHODS
    //
    public InternalVariables getInternalVariables() { throw undefinedOperation(); }

    

Returns:
a list of all variable names (ivar/cvar/constant/internal)
    public List<StringgetVariableNameList() { throw undefinedOperation(); }
    public void copySpecialInstanceVariables(IRubyObject clone) { throw undefinedOperation(); }
    public Object getVariable(int index) { throw undefinedOperation(); }
    public void setVariable(int indexObject value) { throw undefinedOperation(); }
    @Override
    public String toString() {
        return "%undefined";
    }
    @Override
    public void visit(IRVisitor visitor) {
        visitor.UndefinedValue(this);
    }
New to GrepCode? Check out our FAQ X