| |||||||||||||
Passing single values from a Mosel model to a Java method Description Demonstrates calling a Java method from a Mosel model, passing in a string and an integer, and receiving a string.
You must compile the Java file before running the example - e.g. javac PassValues.java
Source Files By clicking on a file name, a preview is opened at the bottom of this page.
PassValues.java /** * Example Java class, containing a method that returns a string based on arguments passed to it * * @author J.Farmer, (c) Fair Isaac Corporation, 2016 **/ public class PassValues { public static String repeatValue(String value, int nRepetitions) { StringBuilder result = new StringBuilder(); for (int i=0;i<nRepetitions;i++) { result.append(value); } return result.toString(); } } | |||||||||||||
© Copyright 2023 Fair Isaac Corporation. |