Top Fields Constructors Methods
org.jruby.internal.runtime.methods

public abstract Class DelegatingDynamicMethod

extends DynamicMethod
Class Inheritance
Known Direct Subclasses
org.jruby.internal.runtime.methods.ProfilingDynamicMethod, org.jruby.internal.runtime.methods.SynchronizedDynamicMethod
Imports
org.jruby.RubyModule, org.jruby.runtime.Arity, .Block, .CallType, .Signature, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.ivars.MethodData, java.util.Collection

Field Summary

Modifier and TypeField and Description
protected final DynamicMethod
Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
aliasCountdefinedClassflagshandleimplementationClassnameprotectedClassserialNumber

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
call(ThreadContext
The thread context for the currently executing thread
context
,
IRubyObject
The 'self' or 'receiver' object to use for this call
self
,
RubyModule
The Ruby class against which this method is binding
klazz
,
String
The incoming name used to invoke this method
name
,
IRubyObject[]
The first argument to this invocation
args
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

A default implementation of n-arity, non-block 'call' method, which simply calls the n-arity, block-receiving version with the arg list and Block.NULL_BLOCK.

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
call(ThreadContext
The thread context for the currently executing thread
context
,
IRubyObject
The 'self' or 'receiver' object to use for this call
self
,
RubyModule
The Ruby class against which this method is binding
klazz
,
String
The incoming name used to invoke this method
name
,
IRubyObject[]
The argument list to this invocation
args
,
Block
The block passed to this invocation
block
)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

The minimum 'call' method required for a dynamic method handle.

public abstract DynamicMethod
dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes.

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public Arity
getArity()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Deprecated

Retrieve the arity of this method, used for reporting arity to Ruby code.

public DynamicMethod
public Object
getHandle()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getHandle.

Get the "handle" associated with this DynamicMethod.

public RubyModule
getImplementationClass()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getImplementationClass.

Retrieve the class or module on which this method is implemented, used for 'super' logic among others.

public Collection<String>
public MethodData
getMethodData()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getMethodData.

Additional metadata about this method.

public String
getName()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getName.

Get the base name this method was defined as.

protected RubyModule
getProtectedClass()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getProtectedClass.

Retrieve the pre-calculated "protected class" used for access checks.

public DynamicMethod
getRealMethod()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getRealMethod.

Get the "real" method contained within this method.

public long
getSerialNumber()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSerialNumber.

Get the global serial number for this method object

public Signature
getSignature()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSignature.

Retrieve the signature of this method.

public Visibility
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isBuiltin()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isBuiltin.

Whether this method is a builtin method, i.e. a method built-in to JRuby and loaded during its core boot process.

public boolean
isCallableFrom(IRubyObject
The calling object
caller
,
CallType
The type of call
callType
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isCallableFrom.

Determine whether this method is callable from the given object using the given call type.

public boolean
public boolean
isNative()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isNative.

Returns true if this method is backed by native (i.e. Java) code.

public boolean
isNotImplemented()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isNotImplemented.

Whether this method is "not implemented".

public boolean
public void
setHandle(Object
the handle
handle
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setHandle.

Set the "handle" associated with this DynamicMethod.

public void
setImplementationClass(RubyModule
The class on which this method is implemented
implClass
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setImplementationClass.

Set the class on which this method is implemented, used for 'super' logic, among others.

public void
setIsBuiltin(boolean
true if this is a core built-in method, false otherwise
isBuiltin
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setIsBuiltin.

Force this method to be treated as a core built-in method if true, or as a normal non-core method otherwise.

public void
setNotImplemented(boolean
is this not implement or not
setNotImplemented
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setNotImplemented.

Set whether this method is "not implemented".

public void
setVisibility(Visibility
The visibility of this method
visibility
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setVisibility.

Set the visibility of this method.

Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
adjustAliasCountcalculateProtectedClasscallRespondTogetAliasCountgetCallConfiggetDefinedClassinitinitisNullisUndefinedsetCallConfigsetDefinedClasssetRuby2Keywords

Field Detail

delegateback to summary
protected final DynamicMethod delegate

Constructor Detail

DelegatingDynamicMethodback to summary
public DelegatingDynamicMethod(DynamicMethod delegate)

Method Detail

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

A default implementation of n-arity, non-block 'call' method, which simply calls the n-arity, block-receiving version with the arg list and Block.NULL_BLOCK.

Parameters
context:ThreadContext

The thread context for the currently executing thread

self:IRubyObject

The 'self' or 'receiver' object to use for this call

klazz:RubyModule

The Ruby class against which this method is binding

name:String

The incoming name used to invoke this method

args:IRubyObject[]

The first argument to this invocation

Returns:IRubyObject

The result of the call

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, Block block)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, Block block)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, Block block)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The minimum 'call' method required for a dynamic method handle. Subclasses must implement this method, but may implement the other signatures to provide faster, non-boxing call paths. Typically subclasses will implement this method to check variable arity calls, then performing a specific-arity invocation to the appropriate method or performing variable-arity logic in-line.

Parameters
context:ThreadContext

The thread context for the currently executing thread

self:IRubyObject

The 'self' or 'receiver' object to use for this call

klazz:RubyModule

The Ruby class against which this method is binding

name:String

The incoming name used to invoke this method

args:IRubyObject[]

The argument list to this invocation

block:Block

The block passed to this invocation

Returns:IRubyObject

The result of the call

dupback to summary
public abstract DynamicMethod dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.dup.

Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes. It is not required that this method produce a new object if the semantics of the DynamicMethod subtype do not require such.

Returns:DynamicMethod

An identical DynamicMethod object to the target.

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getArityback to summary
public Arity getArity()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Deprecated

Retrieve the arity of this method, used for reporting arity to Ruby code. This arity may or may not reflect the actual specific or variable arities of the referenced method.

Returns:Arity

The arity of the method, as reported to Ruby consumers.

Annotations
@Deprecated
@Override
getDelegateback to summary
public DynamicMethod getDelegate()
getHandleback to summary
public Object getHandle()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getHandle.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getHandle.

Get the "handle" associated with this DynamicMethod.

Returns:Object

the handle

Annotations
@Override
getImplementationClassback to summary
public RubyModule getImplementationClass()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getImplementationClass.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getImplementationClass.

Retrieve the class or module on which this method is implemented, used for 'super' logic among others.

Returns:RubyModule

The class on which this method is implemented

Annotations
@Override
getInstanceVariableNamesback to summary
public Collection<String> getInstanceVariableNames()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getInstanceVariableNames.

Annotations
@Override
getMethodDataback to summary
public MethodData getMethodData()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getMethodData.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getMethodData.

Additional metadata about this method.

Returns:MethodData

method data (defined in sub classes)

Annotations
@Override
getNameback to summary
public String getName()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getName.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getName.

Get the base name this method was defined as.

Returns:String

the base name for the method

Annotations
@Override
getProtectedClassback to summary
protected RubyModule getProtectedClass()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getProtectedClass.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getProtectedClass.

Retrieve the pre-calculated "protected class" used for access checks.

Returns:RubyModule

The "protected class" for access checks.

Annotations
@Override
getRealMethodback to summary
public DynamicMethod getRealMethod()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getRealMethod.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getRealMethod.

Get the "real" method contained within this method. This simply returns self except in cases where a method is wrapped to give it a new name or new implementation class (AliasMethod, PartialDelegatingMethod, ...).

Returns:DynamicMethod

The "real" method associated with this one

Annotations
@Override
getSerialNumberback to summary
public long getSerialNumber()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSerialNumber.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getSerialNumber.

Get the global serial number for this method object

Returns:long

This method object's serial number

Annotations
@Override
getSignatureback to summary
public Signature getSignature()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSignature.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getSignature.

Retrieve the signature of this method.

Returns:Signature

the signature

Annotations
@Override
getVisibilityback to summary
public Visibility getVisibility()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getVisibility.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getVisibility.

Get the visibility of this method.

Returns:Visibility

The visibility of this method

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isBuiltinback to summary
public boolean isBuiltin()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isBuiltin.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.isBuiltin.

Whether this method is a builtin method, i.e. a method built-in to JRuby and loaded during its core boot process.

Returns:boolean

true if this is a core built-in method, false otherwise

Annotations
@Override
isCallableFromback to summary
public boolean isCallableFrom(IRubyObject caller, CallType callType)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isCallableFrom.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.isCallableFrom.

Determine whether this method is callable from the given object using the given call type.

Parameters
caller:IRubyObject

The calling object

callType:CallType

The type of call

Returns:boolean

true if the call would not violate visibility; false otherwise

Annotations
@Override
isImplementedByback to summary
public boolean isImplementedBy(RubyModule other)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isImplementedBy.

Annotations
@Override
isNativeback to summary
public boolean isNative()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isNative.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.isNative.

Returns true if this method is backed by native (i.e. Java) code.

Returns:boolean

true If backed by Java code or JVM bytecode; false otherwise

Annotations
@Override
isNotImplementedback to summary
public boolean isNotImplemented()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isNotImplemented.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.isNotImplemented.

Whether this method is "not implemented". This is primarily to support Ruby 1.9's behavior of respond_to? yielding false if the feature in question is unsupported (but still having the method defined).

Returns:boolean

is this a method which is marked as not implemented

Annotations
@Override
isRefinedback to summary
public boolean isRefined()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.isRefined.

Annotations
@Override
setHandleback to summary
public void setHandle(Object handle)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setHandle.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setHandle.

Set the "handle" associated with this DynamicMethod.

Parameters
handle:Object

the handle

Annotations
@Override
setImplementationClassback to summary
public void setImplementationClass(RubyModule implClass)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setImplementationClass.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setImplementationClass.

Set the class on which this method is implemented, used for 'super' logic, among others.

Parameters
implClass:RubyModule

The class on which this method is implemented

Annotations
@Override
setIsBuiltinback to summary
public void setIsBuiltin(boolean isBuiltin)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setIsBuiltin.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setIsBuiltin.

Force this method to be treated as a core built-in method if true, or as a normal non-core method otherwise.

Parameters
isBuiltin:boolean

true if this is a core built-in method, false otherwise

Annotations
@Override
setNotImplementedback to summary
public void setNotImplemented(boolean setNotImplemented)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setNotImplemented.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setNotImplemented.

Set whether this method is "not implemented".

Parameters
setNotImplemented:boolean

is this not implement or not

Annotations
@Override
setVisibilityback to summary
public void setVisibility(Visibility visibility)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.setVisibility.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.setVisibility.

Set the visibility of this method.

Parameters
visibility:Visibility

The visibility of this method

Annotations
@Override