Prolog to Java interface question