com.aptana.ide.editor.js.runtime
Interface IFunction

All Known Implementing Classes:
FunctionBase, JSArrayConstructor, JSBooleanConstructor, JSDateConstructor, JSErrorConstructor, JSFunction, JSFunctionConstructor, JSNumberConstructor, JSObjectConstructor, JSRegExpConstructor, JSStringConstructor, NativeConstructorBase

public interface IFunction

Author:
Kevin Lindsey

Method Summary
 IObject construct(Environment environment, IObject[] arguments, int fileIndex, IRange sourceRegion)
          Constructs a new Object with using the passed arguments.
 IScope getBodyScope()
          Return the scope that is in affect within
 IInvokeTypeProvider getInvokeTypeProvider()
          Get this functions invoke type provider
 java.lang.String[] getParameterNames()
          Return a string array of the parameters for this IFunction
 IObject invoke(Environment environment, IObject[] arguments, int fileIndex, IRange sourceRegion)
          Invoke this method with the specified parameters
 void setBodyScope(IScope scope)
          Set the scope to be used in this IFunction's body
 void setInvokeTypeProvider(IInvokeTypeProvider typeProvider)
          Set a type provider to be used to determine this function's return type when this function is not documented
 void setParameterNames(java.lang.String[] parameters)
          Set the parameter names used to define this IFunction
 

Method Detail

getBodyScope

IScope getBodyScope()
Return the scope that is in affect within

Returns:
Returns the IFunction body's scope

setBodyScope

void setBodyScope(IScope scope)
Set the scope to be used in this IFunction's body

Parameters:
scope - The new scope to use in this function's body

getParameterNames

java.lang.String[] getParameterNames()
Return a string array of the parameters for this IFunction

Returns:
Returns a string array of parameter names

setParameterNames

void setParameterNames(java.lang.String[] parameters)
Set the parameter names used to define this IFunction

Parameters:
parameters - A string array of parameters names

getInvokeTypeProvider

IInvokeTypeProvider getInvokeTypeProvider()
Get this functions invoke type provider

Returns:
Returns the associated type provider or null

setInvokeTypeProvider

void setInvokeTypeProvider(IInvokeTypeProvider typeProvider)
Set a type provider to be used to determine this function's return type when this function is not documented

Parameters:
typeProvider - The type provider

construct

IObject construct(Environment environment,
                  IObject[] arguments,
                  int fileIndex,
                  IRange sourceRegion)
Constructs a new Object with using the passed arguments.

Parameters:
environment -
arguments - The arguments to use in constructing the new object.
fileIndex - The file index
sourceRegion - The region of text within the source file that represents the construction of this instance
Returns:
Returns a newly constructed object.

invoke

IObject invoke(Environment environment,
               IObject[] arguments,
               int fileIndex,
               IRange sourceRegion)
Invoke this method with the specified parameters

Parameters:
environment -
arguments - The arguments to use in constructing the new object.
fileIndex - The file index
sourceRegion - The region of text within the source file that represents the construction of this instance
Returns:
Returns a newly constructed object.