Added a new Examples folder with modified Examples/java files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-cherylfoil@10763 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4f2a579d6d
commit
311ddbc2bf
78 changed files with 3668 additions and 0 deletions
38
Examples/doxygencomments/java/enum/main.java
Normal file
38
Examples/doxygencomments/java/enum/main.java
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
public class main {
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("example");
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
// Print out the value of some enums
|
||||
System.out.println("*** color ***");
|
||||
System.out.println(" " + color.RED + " = " + color.RED.swigValue());
|
||||
System.out.println(" " + color.BLUE + " = " + color.BLUE.swigValue());
|
||||
System.out.println(" " + color.GREEN + " = " + color.GREEN.swigValue());
|
||||
|
||||
System.out.println("\n*** Foo::speed ***");
|
||||
System.out.println(" Foo::" + Foo.speed.IMPULSE + " = " + Foo.speed.IMPULSE.swigValue());
|
||||
System.out.println(" Foo::" + Foo.speed.WARP + " = " + Foo.speed.WARP.swigValue());
|
||||
System.out.println(" Foo::" + Foo.speed.LUDICROUS + " = " + Foo.speed.LUDICROUS.swigValue());
|
||||
|
||||
System.out.println("\nTesting use of enums with functions\n");
|
||||
|
||||
example.enum_test(color.RED, Foo.speed.IMPULSE);
|
||||
example.enum_test(color.BLUE, Foo.speed.WARP);
|
||||
example.enum_test(color.GREEN, Foo.speed.LUDICROUS);
|
||||
|
||||
System.out.println( "\nTesting use of enum with class method" );
|
||||
Foo f = new Foo();
|
||||
|
||||
f.enum_test(Foo.speed.IMPULSE);
|
||||
f.enum_test(Foo.speed.WARP);
|
||||
f.enum_test(Foo.speed.LUDICROUS);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue