com.aptana.ide.editor.js.runtime
Class Environment

java.lang.Object
  extended by com.aptana.ide.editor.js.runtime.Environment
All Implemented Interfaces:
IRuntimeEnvironment

public class Environment
extends java.lang.Object
implements IRuntimeEnvironment

Author:
Kevin Lindsey, Robin Debreuil

Constructor Summary
Environment()
          Environment
 
Method Summary
 IObject createArray(int fileIndex, IRange sourceRegion)
          Create a runtime array object
 IObject createBoolean(int fileIndex, IRange sourceRegion)
          Create a runtime boolean object
 IObject createDate(int fileIndex, IRange sourceRegion)
          Create a runtime date object
 IObject createError(int fileIndex, IRange sourceRegion)
          Create a runtime error object
 IObject createFunction(int fileIndex, IRange sourceRegion)
          Create a runtime function object
 JSNull createNull()
          Create a runtime null value.
 IObject createNumber(int fileIndex, IRange sourceRegion)
          Create a runtime number object
 IObject createObject(int fileIndex, IRange sourceRegion)
          Create a runtime object object
 IObject createRegExp(int fileIndex, IRange sourceRegion)
          Create a runtime regExp object
 IObject createString(int fileIndex, IRange sourceRegion)
          Create a runtime string object
 JSUndefined createUndefined()
          Create a runtime undefined value.
 JSScope getGlobal()
          Get the global object for this Environment
 JSScope initBuiltInObjects()
          Initialize the built-in objects and return the global object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Environment

public Environment()
Environment

Method Detail

getGlobal

public JSScope getGlobal()
Get the global object for this Environment

Returns:
Returns the global scope for this environment

createArray

public IObject createArray(int fileIndex,
                           IRange sourceRegion)
Create a runtime array object

Parameters:
fileIndex - The file index
sourceRegion - The region within the source file that creates this object
Returns:
A runtime array object

createBoolean

public IObject createBoolean(int fileIndex,
                             IRange sourceRegion)
Create a runtime boolean object

Parameters:
fileIndex - The file index
sourceRegion - The region within the source file that creates this object
Returns:
A runtime boolean object

createDate

public IObject createDate(int fileIndex,
                          IRange sourceRegion)
Create a runtime date object

Parameters:
fileIndex - The file index
sourceRegion - The region within the source file that creates this object
Returns:
A runtime date object

createError

public IObject createError(int fileIndex,
                           IRange sourceRegion)
Create a runtime error object

Parameters:
fileIndex - The file index
sourceRegion - The region within the source file that creates this object
Returns:
A runtime error object

createFunction

public IObject createFunction(int fileIndex,
                              IRange sourceRegion)
Create a runtime function object

Parameters:
fileIndex - The file index
sourceRegion - the region within the source file that creates this object
Returns:
A runtime function object

createNull

public JSNull createNull()
Create a runtime null value. This returns a singleton instance of JSNull

Returns:
A runtime JSNull object

createNumber

public IObject createNumber(int fileIndex,
                            IRange sourceRegion)
Create a runtime number object

Parameters:
fileIndex - The file index
sourceRegion - The region within the source file that creates this object
Returns:
A runtime number object

createObject

public IObject createObject(int fileIndex,
                            IRange sourceRegion)
Create a runtime object object

Parameters:
fileIndex - The file index
sourceRegion - TODO
Returns:
A runtime object object

createRegExp

public IObject createRegExp(int fileIndex,
                            IRange sourceRegion)
Create a runtime regExp object

Parameters:
fileIndex - The file index
sourceRegion - The region within the source file that creates this object
Returns:
A runtime regExp object

createString

public IObject createString(int fileIndex,
                            IRange sourceRegion)
Create a runtime string object

Parameters:
fileIndex - The file index
sourceRegion - The region within the source file that creates this object
Returns:
A runtime string object

createUndefined

public JSUndefined createUndefined()
Create a runtime undefined value. This returns a singleton instance of JSNull

Returns:
A runtime JSUndefined object

initBuiltInObjects

public JSScope initBuiltInObjects()
Initialize the built-in objects and return the global object

Returns:
The global object