TWiki . Doc . UsingNiceFromJava

This topic gives some tips and hints how to use Nice from Java

java -> nice method

javanice
package test;
import java.util.*;

public class Foo {
 static public List getList() {
  List l = new ArrayList();
  A a = new A("");
  fun.setName(a,"ich");
  l.add(a);
      
  a = new A("");
  fun.setName(a,"du");
  l.add(a);
      
  return l;
 }
}
package test;
import java.util.*;

public void main(String[] args) {
 getList().foreach(A a => println(a.name));
}

List<A> getList() = native List Foo.barList();


class A {
 String name;
 void setName(String n) {name = n;}
}

-- AlexGreif - 07 Mar 2003

----- Revision r1.2 - 07 Mar 2003 - 13:23 GMT - DanielBonniot
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.