Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "VJET/Semantic Comparison - Java and vjojs"

 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{|
+
The following tables summarize the semantic similarities between Java and VjO.
| style="background:red; color:white" | abc
+
| def
+
| bgcolor="red" | <span style="color:white"> ghi </span>
+
| jkl
+
|}
+
 
+
  
 
{| style="background-color:#F9F9F9;border:1px solid #AAAAAA;border-collapse:collapse;color:black; margin:1em 0;"
 
{| style="background-color:#F9F9F9;border:1px solid #AAAAAA;border-collapse:collapse;color:black; margin:1em 0;"
 
|-  
 
|-  
! header 1 style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;"
+
! style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;" | Semantic
! header 2 style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;"
+
! style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;" | Java
! header 3 style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;"
+
! style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;" | VJET VJO
 
|-
 
|-
| row 1, cell 1 style="border: 1px solid #AAAAAA;padding: 0.2em;"
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Declare a Namespace
| row 1, cell 2 style="border: 1px solid #AAAAAA;padding: 0.2em;"
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | package vjo.x.y
| row 1, cell 3 style="border: 1px solid #AAAAAA;padding: 0.2em;"
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
|-
+
| row 2, cell 1 style="border: 1px solid #AAAAAA;padding: 0.2em;"
+
| row 2, cell 2 style="border: 1px solid #AAAAAA;padding: 0.2em;"
+
| row 2, cell 3 style="border: 1px solid #AAAAAA;padding: 0.2em;"
+
|}
+
 
+
The following tables summarize the semantic similarities between Java and VjO.
+
 
+
<!-- table start -->
+
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable"
+
<!-- header row start -->
+
! '''Semantic''' !! '''Java''' !! '''VJET VJO'''
+
<!-- header row end -->
+
|-
+
|  Declare a Namespace
+
|  package vjo.x.y
+
|  <br/> 
+
|}<!-- table end -->
+
 
+
<br/>
+
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
+
 
vjo.ctype("vjo.x.y.Z") // where Z is the name of a class.
 
vjo.ctype("vjo.x.y.Z") // where Z is the name of a class.
</pre><!-- code end-->
+
</source>
 
   
 
   
 
|-
 
|-
| Import a Class  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Import a Class  
| import vjo.utils.X  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | import vjo.utils.X   
|  <br/>  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
+
 
.needs("vjo.utils.X")
 
.needs("vjo.utils.X")
</pre><!-- code end-->
+
</source>  
+
|}
  
 
=== Type Definitions and Manipulation ===
 
=== Type Definitions and Manipulation ===
  
<!-- table start -->
+
{| style="background-color:#F9F9F9;border:1px solid #AAAAAA;border-collapse:collapse;color:black; margin:1em 0;"
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable"  
+
|-
<!-- header row start -->
+
! style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;" | Semantic
! '''Semantic''' !! '''Java''' !! '''VJET VJO'''
+
! style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;" | Java  
<!-- header row end -->
+
! style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;" | VJET VJO
 
|-
 
|-
| Define a Class
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Define a Class  
|}<!-- table end -->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">class X{}</source>
 
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<br/>
+
vjo.ctype("<namespace>.X")
<!-- code start-->
+
</source>
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">class X{}</pre><!-- code end-->
+
+
|
+
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.ctype("<namespace>.X")</pre><!-- code end-->
+
 
   
 
   
 
|-
 
|-
| Define an Interface
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Define an Interface  
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">interface Y{}</source>   
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">interface Y{}</pre><!-- code end-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
   
+
vjo.itype("<namespace>.Y")
|
+
</source>  
<!-- code start-->
+
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.itype("<namespace>.Y")</pre><!-- code end-->
+
+
 
|-
 
|-
| Define an Enum
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Define an Enum  
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">enum E{}</source>   
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">enum E{}</pre><!-- code end-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
   
+
vjo.etype("<namespace>.E")
|
+
</source>  
<!-- code start-->
+
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.etype("<namespace>.E")</pre><!-- code end-->
+
+
 
|-
 
|-
| Define an Abstract Class
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Define an Abstract Class  
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">abstract class Z{}</source>   
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">abstract class Z{}</pre><!-- code end-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
   
+
//> abstract
|
+
vjo.ctype("<namespace>.Z")
<!-- code start-->
+
</source>  
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//> abstract
+
 
vjo.ctype("<namespace>.Z")</pre><!-- code end-->
+
+
 
|-
 
|-
| Define an Inner Class
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Define an Inner Class  
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">class X{}</source>   
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">class X{}</pre><!-- code end-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
   
+
X : vjo.ctype()
|
+
</source>  
<!-- code start-->
+
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">X : vjo.ctype()</pre><!-- code end-->
+
+
 
|-
 
|-
| Modify a Type
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Modify a Type  
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">final class R{};</source>   
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">final class R{};</pre><!-- code end-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
   
+
//> final
|
+
vjo.ctype("vjo.R")
<!-- code start-->
+
</source>  
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//> final
+
 
vjo.ctype("vjo.R")</pre><!-- code end-->
+
+
 
|-
 
|-
| Define a Constructor
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Define a Constructor    
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">D(){}</source>   
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">D(){}</pre><!-- code end-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
   
+
constructs: function(){}
|
+
</source>  
<!-- code start-->
+
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">constructs: function(){}</pre><!-- code end-->
+
+
 
|-
 
|-
| Overload a Constructor
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Overload a Constructor    
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">D(int arg){}
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">D(int arg){}
+
D(String arg){}</source>   
D(String arg){}</pre><!-- code end-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
   
+
//>public void constructs(int arg)
|
+
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//>public void constructs(int arg)
+
 
//>public void constructs(String arg)
 
//>public void constructs(String arg)
constructs:function(arg){}</pre><!-- code end-->
+
constructs:function(arg){}
+
</source>  
 +
 
 
|-
 
|-
| Call a Super Constructor  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Call a Super Constructor    
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">super()</source>   
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">super()</pre><!-- code end-->
+
this.base()
   
+
</source>  
|
+
 
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">this.base()</pre><!-- code end-->
+
+
 
|-
 
|-
| Call a Super Constructor with Arguments  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Call a Super Constructor with Arguments    
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">super(arg)</source>   
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">super(arg)</pre><!-- code end-->
+
this.base(arg)
   
+
</source>  
|
+
 
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">this.base(arg)</pre><!-- code end-->
+
+
 
|-
 
|-
| Call a Super Method  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Call a Super Method    
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">super.doIt()</source>   
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">super.doIt()</pre><!-- code end-->
+
this.base.doIt()
   
+
</source>  
|
+
 
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">this.base.doIt()</pre><!-- code end-->
+
+
 
|-
 
|-
| Extend a Class  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Extend a Class      
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">class X extends Y</source>   
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">class X extends Y</pre><!-- code end-->
+
vjo.ctype("<namespace>.X")
   
+
.inherits("<namespace>.Y")
|
+
</source>  
<!-- code start-->
+
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.ctype("<namespace>.X")
+
.inherits("<namespace>.Y")</pre><!-- code end-->
+
+
 
|-
 
|-
| Implement an Interface  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Implement an Interface      
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">class X implements Y</source>   
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">class X implements Y</pre><!-- code end-->
+
vjo.ctype("<namespace>.X")
   
+
.satisfies("<namespace>.Y")
|
+
</source>  
<!-- code start-->
+
 
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.ctype("<namespace>.X")
+
.satisfies("<namespace>.Y")</pre><!-- code end-->
+
+
 
|-
 
|-
| Implement an Instance Method  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Implement an Instance Method        
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">void setName(String name)</source>
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">void setName(String name)</pre><!-- code end-->
+
.protos({
 
+
setName: function(String name)
<!-- code start-->
+
</source>  
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">.protos({
+
setName: function(String name)</pre><!-- code end-->
+
  
})
 
 
|-
 
|-
| Implement a Static Method  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Implement a Static Method        
| <br/> 
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">static void setName(String name)</source>
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">
+
.props({
static void setName(String name)
+
</pre><!-- code end-->
+
 
+
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">.props({
+
 
setName: function(String name)
 
setName: function(String name)
})</pre><!-- code end-->
+
})
+
</source>  
 +
 
 
|-
 
|-
| Implement a Static Initializer
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Implement a Static Initializer          
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">{// static initialization here
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">{// static initialization here
+
static{...}</source>   
static{...}</pre><!-- code end-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
   
+
// static initialization here
|
+
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">// static initialization here
+
 
.inits(function(){...})
 
.inits(function(){...})
</pre><!-- code end-->
+
</source>  
+
 
 +
|}
  
  
test
 
  
 
==== Declarations ====
 
==== Declarations ====
  
<!-- table start -->
+
{| style="background-color:#F9F9F9;border:1px solid #AAAAAA;border-collapse:collapse;color:black; margin:1em 0;"
{| border=1  width="100%" cellspacing="0" cellpadding="4" style="border-color:#eee" class="wikitable sortable"  
+
|-
<!-- header row start -->
+
! style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;" | To Declare
! '''To Declare''' !! '''Java''' !! '''VJET VJO'''
+
! style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;" | Java  
<!-- header row end -->
+
! style="background-color:#F2F2F2;text-align:center;border:1px solid #AAAAAA;padding:0.2em;" | VJET VJO
 
|-
 
|-
| Enum Constants
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | Enum Constants  
|}<!-- table end -->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
 
+
public enum Days {
<br/>
+
<!-- code start-->
+
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public enum Days {
+
 
MON,TUE,WED,THU,FRI,SAT,SUN
 
MON,TUE,WED,THU,FRI,SAT,SUN
}</pre><!-- code end-->
+
}
+
</source>
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
vjo.etype('<namespace>.Days')
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">vjo.etype('<namespace>.Days')
+
.values('MON,TUE,WED,THU,FRI,SAT,SUN')
.values('MON,TUE,WED,THU,FRI,SAT,SUN')</pre><!-- code end-->
+
</source>
 
   
 
   
 
|-
 
|-
|  Argument Types
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" |  Argument Types  
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">void setName(String name){}</pre><!-- code end-->
+
void setName(String name){}
+
</source>
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
//> void setName(String name)
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//> void setName(String name)
+
setName : function(name){}
setName : function(name){}</pre><!-- code end-->
+
</source>
+
 
 
|-
 
|-
| Method Scope
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" |  Method Scope  
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public void setName(String name){}</pre><!-- code end-->
+
public void setName(String name){}
+
</source>
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
//>public void setName(String name)
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//>public void setName(String name)
+
setName : function(name){}
setName : function(name){}</pre><!-- code end-->
+
</source>
+
 
 
|-
 
|-
| Return Type
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" |  Return Type  
<!-- code start-->
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public X getIt(){}</pre><!-- code end-->
+
public X getIt(){}
+
</source>
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
//> public X getIt()
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//> public X getIt()
+
getIt : function(){}
getIt : function(){}</pre><!-- code end-->
+
</source>
+
 
 
|-
 
|-
| Overloaded Method  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" |    Overloaded Method  
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
public X getIt(String x)
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public X getIt(String x)
+
public X getIt(int x)
public X getIt(int x)</pre><!-- code end-->
+
</source>
 
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
//>public X getIt(String x)
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//>public X getIt(String x)
+
 
//>public X getIt(int x)
 
//>public X getIt(int x)
getIt:function(x) {}</pre><!-- code end-->
+
getIt:function(x) {}
+
</source>
 +
 
 
|-
 
|-
| Method with Variable Arguments  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" |  Method with Variable Arguments  
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
public X getIt(String... x)
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">public X getIt(String... x)</pre><!-- code end-->
+
</source>
 
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
//>public X getIt(String... x)
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">//>public X getIt(String... x)
+
getIt:function(x) {}
getIt:function(x) {}</pre><!-- code end-->
+
</source>
+
 
 
|-
 
|-
| Local Variable  
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" |  Local Variable  
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
int x = 10;
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">int x = 10;
+
 
String s = "hello";
 
String s = "hello";
final boolean ok = false;</pre><!-- code end-->
+
final boolean ok = false;
+
</source>
|
+
| style="border:1px solid #AAAAAA;padding: 0.2em;" | <source lang="javascript">
<!-- code start-->
+
var x = 10; //< int
<pre style="margin-left:20px; font-size:1.4em; background-color:#fdfdfd">var x = 10; //< int
+
 
var s = 'hello'; //< String
 
var s = 'hello'; //< String
var ok = false; //< final boolean</pre><!-- code end-->
+
var ok = false; //< final boolean
 +
</source>
 +
 
 +
|}
 +
 
 +
 
 +
[[Category:VJET|VJOJS]]
 +
[[Category:JavaScript]]

Latest revision as of 19:26, 2 May 2013

The following tables summarize the semantic similarities between Java and VjO.

Semantic Java VJET VJO
Declare a Namespace package vjo.x.y
vjo.ctype("vjo.x.y.Z") // where Z is the name of a class.
Import a Class import vjo.utils.X
.needs("vjo.utils.X")

Type Definitions and Manipulation

Semantic Java VJET VJO
Define a Class
class X{}
vjo.ctype("<namespace>.X")
Define an Interface
interface Y{}
vjo.itype("<namespace>.Y")
Define an Enum
enum E{}
vjo.etype("<namespace>.E")
Define an Abstract Class
abstract class Z{}
//> abstract
vjo.ctype("<namespace>.Z")
Define an Inner Class
class X{}
X : vjo.ctype()
Modify a Type
final class R{};
//> final
vjo.ctype("vjo.R")
Define a Constructor
D(){}
constructs: function(){}
Overload a Constructor
D(int arg){}
D(String arg){}
//>public void constructs(int arg)
//>public void constructs(String arg)
constructs:function(arg){}
Call a Super Constructor
super()
this.base()
Call a Super Constructor with Arguments
super(arg)
this.base(arg)
Call a Super Method
super.doIt()
this.base.doIt()
Extend a Class
class X extends Y
vjo.ctype("<namespace>.X")
.inherits("<namespace>.Y")
Implement an Interface
class X implements Y
vjo.ctype("<namespace>.X")
.satisfies("<namespace>.Y")
Implement an Instance Method
void setName(String name)
.protos({
setName: function(String name)
Implement a Static Method
static void setName(String name)
.props({
setName: function(String name)
})
Implement a Static Initializer
{// static initialization here
static{...}
// static initialization here
.inits(function(){...})


Declarations

To Declare Java VJET VJO
Enum Constants
public enum Days {
MON,TUE,WED,THU,FRI,SAT,SUN
}
vjo.etype('<namespace>.Days')
.values('MON,TUE,WED,THU,FRI,SAT,SUN')
Argument Types
void setName(String name){}
//> void setName(String name)
setName : function(name){}
Method Scope
public void setName(String name){}
//>public void setName(String name)
setName : function(name){}
Return Type
public X getIt(){}
//> public X getIt()
getIt : function(){}
Overloaded Method
public X getIt(String x)
public X getIt(int x)
//>public X getIt(String x)
//>public X getIt(int x)
getIt:function(x) {}
Method with Variable Arguments
public X getIt(String... x)
//>public X getIt(String... x)
getIt:function(x) {}
Local Variable
int x = 10;
String s = "hello";
final boolean ok = false;
var x = 10; //< int
var s = 'hello'; //< String
var ok = false; //< final boolean

Back to the top