Well in that case, then can you please explain in more detail about what part of your code you are having trouble understanding?
I also have some suggestions:
1) In the comments for the class
you should probably not try to reference example code which doesn't exist in the current code file.
2) I would suggest implementing a Runnable, rather than extending Thread. You can search for why this is a good idea.
3) I would suggest you use better names for the stopping. For example, using stop() instead of setCompleted(). Determining if a task is complete or not is an internal process (i.e. in the code provided it would seem like the process is 'complete' when the for loop is done.) What you want to do is stop the task before it is completed from an external source. That sounds more like stop() to me. Note that using stop() in the code provided might be hard to do, since you extend Thread and Thread has a stop() method which is a public final and deprecated method - just one bit of baggage you get from extending a Thread instead of implementing Runnable.