Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package com.mycompany.app24;
- /**
- *
- * @author Admin
- */
- public class MyLongTask implements Runnable{
- // поддержка принудительной остановки задачи
- private boolean done;
- private MyLongTaskResult result;
- // входные параметры
- private int value1;
- private int value2;
- public MyLongTask(int value1, int value2){
- this.value1 = value1;
- this.value2 = value2;
- }
- @Override
- public void run() {
- // use done for break
- // ...
- //result = new MyLongTaskResult();
- }
- //
- public void done(String m){
- System.out.println("MyLongTask.done invoked with message=" + m);
- this.done = true;
- }
- // MyLongTaskResult
- public MyLongTaskResult getResult(){
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement