~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Examples/java/enum/runme.java

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2009-11-15 14:00:28 UTC
  • mfrom: (1.2.9 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091115140028-me7amr2rie8zz1xn
Tags: 1.3.40-2ubuntu1
* Merge from Debian testing (LP: #356529), remaining changes:
  - Drop libchicken-dev from the build-depends (it's in universe)
  - Remove Pike from package description and from configure flags
  - drop "--without-mzscheme", we don't have it in our build-depends
  - use php-config5
  - Clean Runtime/ as well.
  - debian/rules (clean): Remove Lib/ocaml/swigp4.ml.
* debian/rules: Remove hardcoded python version.
* Remove upper limit for python from Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
public class runme {
 
3
  static {
 
4
    try {
 
5
        System.loadLibrary("example");
 
6
    } catch (UnsatisfiedLinkError e) {
 
7
      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);
 
8
      System.exit(1);
 
9
    }
 
10
  }
 
11
 
 
12
  public static void main(String argv[]) 
 
13
  {
 
14
    // Print out the value of some enums
 
15
    System.out.println("*** color ***");
 
16
    System.out.println("    " + color.RED + " = " + color.RED.swigValue());
 
17
    System.out.println("    " + color.BLUE + " = " + color.BLUE.swigValue());
 
18
    System.out.println("    " + color.GREEN + " = " + color.GREEN.swigValue());
 
19
 
 
20
    System.out.println("\n*** Foo::speed ***");
 
21
    System.out.println("    Foo::" + Foo.speed.IMPULSE + " = " + Foo.speed.IMPULSE.swigValue());
 
22
    System.out.println("    Foo::" + Foo.speed.WARP + " = " + Foo.speed.WARP.swigValue());
 
23
    System.out.println("    Foo::" + Foo.speed.LUDICROUS + " = " + Foo.speed.LUDICROUS.swigValue());
 
24
 
 
25
    System.out.println("\nTesting use of enums with functions\n");
 
26
 
 
27
    example.enum_test(color.RED, Foo.speed.IMPULSE);
 
28
    example.enum_test(color.BLUE, Foo.speed.WARP);
 
29
    example.enum_test(color.GREEN, Foo.speed.LUDICROUS);
 
30
 
 
31
    System.out.println( "\nTesting use of enum with class method" );
 
32
    Foo f = new Foo();
 
33
 
 
34
    f.enum_test(Foo.speed.IMPULSE);
 
35
    f.enum_test(Foo.speed.WARP);
 
36
    f.enum_test(Foo.speed.LUDICROUS);
 
37
  }
 
38
}