factorizationimpl.java

来自「factorization.zip」· Java 代码 · 共 55 行

JAVA
55
字号
package factorization.service.impl;/** * <p>Title: Factorization Library</p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author Vladimir Silva * @version 1.0 */import org.globus.ogsa.impl.ogsi.GridServiceImpl;import factorization.service.Factorization.FactorizationPortType;import java.rmi.RemoteException;import javax.math.factorization.Factorizer;/** * Factorization service Implementation */public class FactorizationImpl extends GridServiceImpl implements FactorizationPortType{      public FactorizationImpl() {            super("Factorization Service");      }      /**       * Factorization Method       * @param bigNum Number to factor       * @param outFile Full path to the server side Output file (Contains factors pd(1)^ exp(1) * .....       * @param options Use "-verbose" to display fac output in the GT server log       */      public String factorize(String bigNum, String outFile, String options) throws RemoteException      {            String[] args = {"-n", bigNum, "-out", outFile, options};            try {                  Factorizer f = new Factorizer(args);                  // dump output: to the console or a file                  f.dumpOutput();                  return buildXML(false, "Out in: " + outFile);            }            catch (Exception ex) {                  return buildXML(true, ex.getClass().getName() + ": " +  ex.getMessage());            }      }      /*       * An XML string is returned w/ service status       */      private String buildXML(boolean error, String text) {            return "<xml><error>" + error + "</error><text>" + text + "</text></xml>";      }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?