Java Doc for DynamicScope.java in  » Scripting » jruby » org » jruby » runtime » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » jruby » org.jruby.runtime 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jruby.runtime.DynamicScope

DynamicScope
public class DynamicScope (Code)
Represents the the dynamic portion of scoping information. The variableValues are the values of assigned local or block variables. The staticScope identifies which sort of scope this is (block or local). Properties of Dynamic Scopes: 1. static and dynamic scopes have the same number of names to values 2. size of variables (and thus names) is determined during parsing. So those structured do not need to change FIXME: When creating dynamic scopes we sometimes accidentally pass in extra parents. This is harmless (other than wasting memory), but we should not do that. We can fix this in two ways: 1. Fix all callers 2. Check parent that is passed in and make if new instance is local, then its parent is not local



Constructor Summary
public  DynamicScope(StaticScope staticScope, DynamicScope parent)
    
public  DynamicScope(StaticScope staticScope)
    

Method Summary
public  DynamicScopecloneScope()
    
public  String[]getAllNamesInScope()
     Get all variable names captured (visible) by this scope (sans $~ and $_).
public  voidgetArgValues(IRubyObject[] args, int size)
     Copy variable values back for ZSuper call.
public  IRubyObjectgetBackRef()
    
public  DynamicScopegetBindingScope()
    
public  IRubyObjectgetLastLine()
    
public  DynamicScopegetNextCapturedScope()
     Get next 'captured' scope.
public  StaticScopegetStaticScope()
     Get the static scope associated with this DynamicScope.
public  IRubyObjectgetValue(int offset, int depth)
     Get value from current scope or one of its captured scopes. FIXME: block variables are not getting primed to nil so we need to null check those until we prime them properly.
public  IRubyObject[]getValues()
    
public  voidgrowIfNeeded()
     Make a larger dynamic scope if the static scope grew.
public  voidsetArgValues(IRubyObject[] values, int size)
     Set all values which represent 'normal' parameters in a call list to this dynamic scope.
public  voidsetBackRef(IRubyObject value)
    
public  voidsetBindingScope(DynamicScope bindingScope)
    
public  voidsetBlockArgValues(IRubyObject[] blockArgValues, int size)
    
public  voidsetLastLine(IRubyObject value)
    
public  voidsetValue(int offset, IRubyObject value, int depth)
     Set value in current dynamic scope or one of its captured scopes.
public  StringtoString()
    


Constructor Detail
DynamicScope
public DynamicScope(StaticScope staticScope, DynamicScope parent)(Code)



DynamicScope
public DynamicScope(StaticScope staticScope)(Code)




Method Detail
cloneScope
public DynamicScope cloneScope()(Code)



getAllNamesInScope
public String[] getAllNamesInScope()(Code)
Get all variable names captured (visible) by this scope (sans $~ and $_). a list of variable names



getArgValues
public void getArgValues(IRubyObject[] args, int size)(Code)
Copy variable values back for ZSuper call.



getBackRef
public IRubyObject getBackRef()(Code)



getBindingScope
public DynamicScope getBindingScope()(Code)



getLastLine
public IRubyObject getLastLine()(Code)



getNextCapturedScope
public DynamicScope getNextCapturedScope()(Code)
Get next 'captured' scope. the scope captured by this scope for implementing closures



getStaticScope
public StaticScope getStaticScope()(Code)
Get the static scope associated with this DynamicScope. static complement to this scope



getValue
public IRubyObject getValue(int offset, int depth)(Code)
Get value from current scope or one of its captured scopes. FIXME: block variables are not getting primed to nil so we need to null check those until we prime them properly. Also add assert back in.
Parameters:
  offset - zero-indexed value that represents where variable lives
Parameters:
  depth - how many captured scopes down this variable should be set the value here



getValues
public IRubyObject[] getValues()(Code)



growIfNeeded
public void growIfNeeded()(Code)
Make a larger dynamic scope if the static scope grew. Eval's with bindings require us to possibly change the size of the dynamic scope if things like 'eval "b = 2", binding' happens.



setArgValues
public void setArgValues(IRubyObject[] values, int size)(Code)
Set all values which represent 'normal' parameters in a call list to this dynamic scope. Function calls bind to local scopes by assuming that the indexes or the arg list correspond to that of the local scope (plus 2 since $_ and $~ always take the first two slots). We pass in a second argument because we sometimes get more values than we are expecting. The rest get compacted by original caller into rest args.
Parameters:
  values - up to size specified to be mapped as ordinary parm values
Parameters:
  size - is the number of values to assign as ordinary parm values



setBackRef
public void setBackRef(IRubyObject value)(Code)



setBindingScope
public void setBindingScope(DynamicScope bindingScope)(Code)



setBlockArgValues
public void setBlockArgValues(IRubyObject[] blockArgValues, int size)(Code)



setLastLine
public void setLastLine(IRubyObject value)(Code)



setValue
public void setValue(int offset, IRubyObject value, int depth)(Code)
Set value in current dynamic scope or one of its captured scopes.
Parameters:
  offset - zero-indexed value that represents where variable lives
Parameters:
  value - to set
Parameters:
  depth - how many captured scopes down this variable should be set



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.