Java Doc for Function.java in  » Scripting » oscript-2.10.4 » oscript » data » 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 » oscript 2.10.4 » oscript.data 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   oscript.data.Value
      oscript.data.Type
         oscript.data.Function

Function
public class Function extends Type (Code)
A script function/constructor. Since native (and other) objects that behave as a function can re-use some functionality (ie checking number of args, type casting, etc., the stuff specific to a script function/ constructor is pushed out into a seperate class.
author:
   Rob Clark (rob@ti.com)

Inner Class :final public static class FunctionData implements Externalizable

Field Summary
final public static  String[]MEMBER_NAMES
    
final public static  StringPARENT_TYPE_NAME
    
final public static  ValueTYPE
     The type object for an script function.
final public static  StringTYPE_NAME
    
final public  FunctionDatafd
     The shared function data...

Constructor Summary
public  Function(Scope enclosingScope, Value superFxn, FunctionData fd)
     Class Constructor.

Method Summary
public  ValuebopCast(Value val)
    
public  ValuecallAsConstructor(StackFrame sf, MemberTable args)
     Call this object as a constructor.
public  ValuecallAsExtends(StackFrame sf, Scope scope, MemberTable args)
     Call this object as a parent class constructor.
public  ValuecallAsFunction(StackFrame sf, MemberTable args)
     Call this object as a function.
public  StringcastToString()
     Convert this object to a native java String value.
public static  ValueextractJavadocComment(Vector specials, Value name, int[] argIds)
    
public static  ValueextractJavadocComment(String str, Value name, Value[] argNames)
    
public static  ValueextractJavadocCommentBody(String str, Value name, Value[] argNames)
    
public  Value[]getArgNames()
     Get the names of the arguments to the function, in order.
public  ValuegetComment()
     Get the comment block.
public  ValuegetMember(int id, boolean exception)
     Get a member of this object.
public  intgetMinimumArgCount()
     Get the minimum number of args that should be passed to this function.
public  ValuegetName()
     Get the name of this function.
 ValuegetOverriden()
     If this function overrides a value, this method returns it.
final  ValuegetStaticMember(int id)
     Get a static member of this function object.
 ValuegetSuper()
     Get the function that this function extends, or null if none.
protected  ValuegetTypeImpl()
     Get the type of this object.
protected  ValuegetTypeMember(Value obj, int id)
     Get a member of this type.
public  booleanisA(Value type)
     If this object is a type, determine if an instance of this type is an instance of the specified type, ie.
protected  voidpopulateMemberSet(Set s, boolean debugger)
     Derived classes that implement Function.getMember should also implement this.
protected  voidpopulateTypeMemberSet(Set s, boolean debugger)
     Derived classes that implement Function.getTypeMember should also implement this.
public  booleantakesVarArgs()
    

Field Detail
MEMBER_NAMES
final public static String[] MEMBER_NAMES(Code)



PARENT_TYPE_NAME
final public static String PARENT_TYPE_NAME(Code)



TYPE
final public static Value TYPE(Code)
The type object for an script function.



TYPE_NAME
final public static String TYPE_NAME(Code)



fd
final public FunctionData fd(Code)
The shared function data... parameters that are shared by all instances of the same function.

public for StackFrame.evalNode





Constructor Detail
Function
public Function(Scope enclosingScope, Value superFxn, FunctionData fd)(Code)
Class Constructor. Construct an anonymous function.
Parameters:
  enclosingScope - the context the function was declared in
Parameters:
  superFxn - the function this function extends, or null
Parameters:
  fd - the shared function data, for all instances of this function




Method Detail
bopCast
public Value bopCast(Value val) throws PackagedScriptObjectException(Code)
Perform the cast operation, (a)b is equivalent to a.bopCast(b)
Parameters:
  val - the other value the result
throws:
  PackagedScriptObjectException - (NoSuchMemberException)



callAsConstructor
public Value callAsConstructor(StackFrame sf, MemberTable args) throws PackagedScriptObjectException(Code)
Call this object as a constructor.
Parameters:
  sf - the current stack frame
Parameters:
  args - the arguments to the function, or null if none the newly constructed object
throws:
  PackagedScriptObjectException -
See Also:   Function



callAsExtends
public Value callAsExtends(StackFrame sf, Scope scope, MemberTable args) throws PackagedScriptObjectException(Code)
Call this object as a parent class constructor.
Parameters:
  sf - the current stack frame
Parameters:
  scope - the object
Parameters:
  args - the arguments to the function, or null if none the value returned by the function
throws:
  PackagedScriptObjectException -
See Also:   Function



callAsFunction
public Value callAsFunction(StackFrame sf, MemberTable args) throws PackagedScriptObjectException(Code)
Call this object as a function.
Parameters:
  sf - the current stack frame
Parameters:
  args - the arguments to the function, or null if none the value returned by the function
throws:
  PackagedScriptObjectException -
See Also:   Function



castToString
public String castToString() throws PackagedScriptObjectException(Code)
Convert this object to a native java String value. a String value
throws:
  PackagedScriptObjectException - (NoSuchMethodException)



extractJavadocComment
public static Value extractJavadocComment(Vector specials, Value name, int[] argIds)(Code)



extractJavadocComment
public static Value extractJavadocComment(String str, Value name, Value[] argNames)(Code)



extractJavadocCommentBody
public static Value extractJavadocCommentBody(String str, Value name, Value[] argNames)(Code)



getArgNames
public Value[] getArgNames()(Code)
Get the names of the arguments to the function, in order. If this function takes a variable number of arguments, the last name in the array is the "var-arg" variable, to which the array of all remaining arguments are bound.



getComment
public Value getComment()(Code)
Get the comment block. If there was a javadoc comment block preceding the definition of this function in the src file, it can be accessed with this method. the function's comment, or null



getMember
public Value getMember(int id, boolean exception) throws PackagedScriptObjectException(Code)
Get a member of this object.
Parameters:
  id - the id of the symbol that maps to the member
Parameters:
  exception - whether an exception should be thrown if themember object is not resolved a reference to the member
throws:
  PackagedScriptObjectException - (NoSuchMethodException)
throws:
  PackagedScriptObjectException - (NoSuchMemberException)



getMinimumArgCount
public int getMinimumArgCount()(Code)
Get the minimum number of args that should be passed to this function. If Function.isVarArgs returns true, then it is possible to pass more arguments to this function, otherwise, you should pass exactly this number of args to the function. minimum number of args to pass when calling this function
See Also:   Function.isVarArgs
See Also:   Function.getArgNames



getName
public Value getName()(Code)
Get the name of this function. An anonymous function will have the name "anon". the function's name



getOverriden
Value getOverriden()(Code)
If this function overrides a value, this method returns it. Otherwise it returns null.



getStaticMember
final Value getStaticMember(int id)(Code)
Get a static member of this function object.



getSuper
Value getSuper()(Code)
Get the function that this function extends, or null if none.



getTypeImpl
protected Value getTypeImpl()(Code)
Get the type of this object. The returned type doesn't have to take into account the possibility of a script type extending a built-in type, since that is handled by Function.getType . the object's type



getTypeMember
protected Value getTypeMember(Value obj, int id)(Code)
Get a member of this type. This is used to interface to the java method of having members be attributes of a type. Regular object- script object's members are attributes of the object, but in the case of java types (including built-in types), the members are attributes of the type.
Parameters:
  obj - an object of this type
Parameters:
  id - the id of the symbol that maps to the member a reference to the member, or null



isA
public boolean isA(Value type)(Code)
If this object is a type, determine if an instance of this type is an instance of the specified type, ie. if this is type, or a subclass.
Parameters:
  type - the type to compare this type to true or false
throws:
  PackagedScriptObjectException - (NoSuchMemberException)



populateMemberSet
protected void populateMemberSet(Set s, boolean debugger)(Code)
Derived classes that implement Function.getMember should also implement this.
Parameters:
  s - the set to populate
Parameters:
  debugger - true if being used by debugger, inwhich case both public and private/protected field names should be returned
See Also:   Function.getMember



populateTypeMemberSet
protected void populateTypeMemberSet(Set s, boolean debugger)(Code)
Derived classes that implement Function.getTypeMember should also implement this.
Parameters:
  s - the set to populate
Parameters:
  debugger - true if being used by debugger, inwhich case both public and private/protected field names should be returned
See Also:   Function.getTypeMember



takesVarArgs
public boolean takesVarArgs()(Code)
Can this function be called with a variable number of arguments?
See Also:   Function.getMinimumArgCount
See Also:   Function.getArgNames



Fields inherited from oscript.data.Type
final public static Value HIDDEN_TYPE(Code)(Java Doc)

Methods inherited from oscript.data.Type
public boolean isA(Value type)(Code)(Java Doc)

Fields inherited from oscript.data.Value
final public static boolean DEBUG(Code)(Java Doc)
final public static String[] MEMBER_NAMES(Code)(Java Doc)
final public static Value NULL(Code)(Java Doc)
final public static String PARENT_TYPE_NAME(Code)(Java Doc)
final public static BuiltinType TYPE(Code)(Java Doc)
final public static String TYPE_NAME(Code)(Java Doc)
final public static Value UNDEFINED(Code)(Java Doc)

Methods inherited from oscript.data.Value
public static Value _getTypeMember(Value type, Value obj, int id)(Code)(Java Doc)
public static void _populateTypeMemberSet(Value type, java.util.Set s, boolean d)(Code)(Java Doc)
public Value bopBitwiseAnd(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopBitwiseAndR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopBitwiseOr(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopBitwiseOrR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopBitwiseXor(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopBitwiseXorR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopCast(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopCastR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopDivide(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopDivideR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopGreaterThan(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopGreaterThanOrEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopGreaterThanOrEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopGreaterThanR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopInstanceOf(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopInstanceOfR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLeftShift(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLeftShiftR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLessThan(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLessThanOrEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLessThanOrEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLessThanR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLogicalAnd(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLogicalAndR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLogicalOr(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopLogicalOrR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopMinus(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopMinusR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopMultiply(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopMultiplyR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopNotEquals(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopNotEqualsR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopPlus(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopPlusR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopRemainder(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopRemainderR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopSignedRightShift(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopSignedRightShiftR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopUnsignedRightShift(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
public Value bopUnsignedRightShiftR(Value val, PackagedScriptObjectException e) throws PackagedScriptObjectException(Code)(Java Doc)
public Value callAsConstructor(StackFrame sf, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value callAsConstructor(Value[] args) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value callAsConstructor(StackFrame sf, Value[] args)(Code)(Java Doc)
public Value callAsExtends(StackFrame sf, Scope scope, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value callAsExtends(Scope scope, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value callAsExtends(StackFrame sf, Scope scope, Value[] args)(Code)(Java Doc)
public Value callAsFunction(StackFrame sf, MemberTable args) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value callAsFunction(Value[] args) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value callAsFunction(StackFrame sf, Value[] args)(Code)(Java Doc)
public boolean castToBoolean() throws PackagedScriptObjectException(Code)(Java Doc)
public long castToExactNumber() throws PackagedScriptObjectException(Code)(Java Doc)
public double castToInexactNumber() throws PackagedScriptObjectException(Code)(Java Doc)
public Object castToJavaObject() throws PackagedScriptObjectException(Code)(Java Doc)
public String castToString() throws PackagedScriptObjectException(Code)(Java Doc)
public Value elementAt(Value idx) throws PackagedScriptObjectException(Code)(Java Doc)
public Value elementsAt(Value idx1, Value idx2) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value getMember(String name) throws PackagedScriptObjectException(Code)(Java Doc)
public Value getMember(Value name) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value getMember(int id) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value getMember(String name, boolean exception) throws PackagedScriptObjectException(Code)(Java Doc)
final public Value getMember(Value name, boolean exception) throws PackagedScriptObjectException(Code)(Java Doc)
public Value getMember(int id, boolean exception) throws PackagedScriptObjectException(Code)(Java Doc)
public Object getMonitor()(Code)(Java Doc)
public Value getType()(Code)(Java Doc)
abstract protected Value getTypeImpl()(Code)(Java Doc)
protected Value getTypeMember(Value obj, int id)(Code)(Java Doc)
final protected Value getTypeMember(Value obj, Value name)(Code)(Java Doc)
public boolean isA(Value type)(Code)(Java Doc)
public int length() throws PackagedScriptObjectException(Code)(Java Doc)
public java.util.Set memberSet()(Code)(Java Doc)
protected PackagedScriptObjectException noSuchMember(String member)(Code)(Java Doc)
public void opAssign(Value val) throws PackagedScriptObjectException(Code)(Java Doc)
protected void populateMemberSet(java.util.Set s, boolean debugger)(Code)(Java Doc)
protected void populateTypeMemberSet(java.util.Set s, boolean debugger)(Code)(Java Doc)
public void readExternal(java.io.ObjectInput in) throws ClassNotFoundException, java.io.IOException(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public Value unhand()(Code)(Java Doc)
public Value uopBitwiseNot() throws PackagedScriptObjectException(Code)(Java Doc)
public Value uopDecrement() throws PackagedScriptObjectException(Code)(Java Doc)
public Value uopIncrement() throws PackagedScriptObjectException(Code)(Java Doc)
public Value uopLogicalNot() throws PackagedScriptObjectException(Code)(Java Doc)
public Value uopMinus() throws PackagedScriptObjectException(Code)(Java Doc)
public Value uopPlus() throws PackagedScriptObjectException(Code)(Java Doc)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException(Code)(Java Doc)

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.