public class TestAllConcepts extends java.lang.Object
typedef struct TestAllConcepts_Test_t { union { ObjectJc object; ImplIfc_Test_s super;} base; int32 simpleInt; ...etc. }The first element of struct is a union, which pools the super class, all interfaces and the ObjectJc-base. The most inner super class has ObjectJc as its first Element, the access to that base of all super classes can accessed immediately in this unit.
Constructor and Description |
---|
TestAllConcepts()
The Constructor of this example.
|
Modifier and Type | Method and Description |
---|---|
void |
access(float x)
A method with same name but other parameter types.
|
int |
access(int x) |
boolean |
equals(java.lang.Object cmp)
Check whether Object.equals() will be overridden.
|
boolean |
equals(java.lang.String cmp)
This method doesn't override Object.equals.
|
void |
finalize()
Example for a special finalize method body.
|
static void |
main(java.lang.String[] args) |
TestAllConcepts |
returnThisOverrideable_Test(int value)
This method helps to test concatenations with return-this, but override-able.
|
public TestAllConcepts()
SimpleDataStruct
).
than this initialization isn't happen.
null
-references,
and all values are default set to 0.
init_ObjectJc(object, sizeof(Instance), ident);
manually at C-level. Static instances can be defined at C-level before starting initialization
in the C-typical wise.
struct TestAllConcepts_Test_t* ctorO_TestAllConcepts_Test(ObjectJc* othis, ThCxt* _thCxt) { TestAllConcepts_Test_s* ythis = (TestAllConcepts_Test_s*)othis; //upcasting to the real class. STACKTRC_TENTRY("ctorO_TestAllConcepts_Test"); checkConsistence_ObjectJc(othis, sizeof(TestAllConcepts_Test_s), null, _thCxt); setReflection_ObjectJc(othis, &reflection_TestAllConcepts_Test_s, sizeof(TestAllConcepts_Test_s));
ObjectJc*
-Reference. This is,
because the calling environment supplied only this base reference. This ObjectJc is initialized,
especially the size of the memory area is set in ObjectJc.objectIdentSize
.
ThCxt* _thCxt
is the reference of the threadContext. It is necessary for exception handling.
STACKTRC_TENTRY(...)
registers the method stack level in thread context.
It is for exception handling with stack-trace dump.
checkConsistence_ObjectJc(...)
tests whether the memory area
referenced with ythis
is initialized properly. Especially the size of the area is tested.
This routine calls an Exception if the conditions are not true. The conditions should be met any time,
elsewhere a user software error is happen. After this test the continuation of initialize is safety.
Without such test the software may be crash here causing of an external error.
setReflection(...)
completes the ObjectJc-Data with the only one special information
regarding the implementation instance. The reflection include the method table too. It is a structured data
defined at C-level in this compilation unit.
public int access(int x)
public TestAllConcepts returnThisOverrideable_Test(int value)
@ java2c=return-this
is written.
value
- any valuepublic boolean equals(java.lang.Object cmp)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public boolean equals(java.lang.String cmp)
public void access(float x)
x
- public void finalize()
TODO copy from C
finalize
in class java.lang.Object
public static void main(java.lang.String[] args)