Examples of Calculator


Examples of client.tasks.Calculator

    public CalculatorForm() {
        initComponents();
    }

    private void calculate(final Calculator.Operation operation) {
        final Calculator calculator = new Calculator(operation,
                                                     new BigDecimal(this.jTextFieldArg0.getText()),
                                                     new BigDecimal(this.jTextFieldArg1.getText()),
                                                     10);
        final RemoteTask remoteTask = new RemoteTask(URL, calculator, this.futureEvent);
        this.executorService.submit(remoteTask);
View Full Code Here

Examples of cn.edu.buu.calculator.model.Calculator

      throws ServletException, IOException {
    String oper1 = request.getParameter("oper1");
    String oper2 = request.getParameter("oper2");
    String operator = request.getParameter("operator");
   
    Calculator calc = new Calculator();
    calc.setOper1(Integer.parseInt(oper1));
    calc.setOper2(Integer.parseInt(oper2));
   
    int result = 0;
   
    if(operator.equals("+")){
      result = calc.add();
    }else if(operator.equals("-")){
      result = calc.minus();
    }else if(operator.equals("*")){
      result = calc.multiplication();
    }else if(operator.equals("/")){
      result = calc.div();
    }else{
     
    }
   
    // �õ�session�ռ�
View Full Code Here

Examples of cn.edu.buu.calculator.model.Calculator

import cn.edu.buu.calculator.model.Calculator;

public class TestCalculator extends TestCase {
 
  public Calculator initCalculator(int op1, int op2){
    Calculator calc = new Calculator();
    calc.setOper1(op1);
    calc.setOper2(op2);
    return calc;
  }
View Full Code Here

Examples of cn.edu.buu.calculator.model.Calculator

    calc.setOper2(op2);
    return calc;
  }
 
  public void testCreate(){
    Calculator calc = new Calculator();
  }
View Full Code Here

Examples of com.apress.progwt.client.calculator.Calculator

    public void onModuleLoad2() {
        try {

            RootPanel.get("loading").setVisible(false);
            RootPanel.get("slot1").add(new Calculator());

        } catch (Exception e) {

            e.printStackTrace();
View Full Code Here

Examples of com.arcmind.jsfquickstart.model.Calculator

    assertEquals("mathError", outcome);
  }

  @Test()
  public void testRandomException() {
    Calculator mockCalc = EasyMock.createMock(Calculator.class);
   
    EasyMock.expect(mockCalc.divide(10, 10)).andThrow(new RuntimeException("random error"));
    EasyMock.replay(mockCalc);
    calcController.setCalculator(mockCalc);
   

    calcController.setFirstNumber(10);
View Full Code Here

Examples of com.l2jfrozen.gameserver.skills.Calculator

      for(int i = 0; i < Stats.NUM_STATS; i++)
      {
        if(NPC_STD_CALCULATOR[i] != null)
        {
          _calculators[i] = new Calculator(NPC_STD_CALCULATOR[i]);
        }
      }
    }

    // Select the Calculator of the affected state in the Calculator set
    int stat = f.stat.ordinal();

    if(_calculators[stat] == null)
    {
      _calculators[stat] = new Calculator();
    }

    // Add the Func to the calculator corresponding to the state
    _calculators[stat].addFunc(f);
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter1.recipe1.task.Calculator

   */
  public static void main(String[] args) {

    //Launch 10 threads that make the operation with a different number
    for (int i=1; i<=10; i++){
      Calculator calculator=new Calculator(i);
      Thread thread=new Thread(calculator);
      thread.start();
    }
  }
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter1.recipe2.task.Calculator

    // Launch 10 threads to do the operation, 5 with the max
    // priority, 5 with the min
    threads=new Thread[10];
    status=new Thread.State[10];
    for (int i=0; i<10; i++){
      threads[i]=new Thread(new Calculator(i));
      if ((i%2)==0){
        threads[i].setPriority(Thread.MAX_PRIORITY);
      } else {
        threads[i].setPriority(Thread.MIN_PRIORITY);
      }
View Full Code Here

Examples of easyliq.Calculators.Calculator

        }
    }
   
    private void Calculate(HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        Calculator calculator = CreateCalculator(request
                .getParameter("calculator"));
        HashSet<Parameter> parameters = calculator.getParametersSet();
        CalculationParameters calcParams = new CalculationParameters();
        for (Parameter p : parameters) {
            String parStr = request.getParameter(p.toString());
            if (parStr == null) {
                calcParams.addUnknown(p);
            } else {
                calcParams.addKnown(p, Double.parseDouble(parStr));
            }
        }
        calculator.Calculate(calcParams);

        response.setContentType("application/json");
        response.setCharacterEncoding("UTF-8");
        String json = "{";
        boolean isFirst = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.