package org.madore.damlengine;

public abstract class TodoItem {

    protected TodoDeque ownerDeque;
    protected final Context ctx;
    protected final TodoItem caller;

    public TodoItem(Context ctx, TodoItem caller) {
	this.ctx = ctx;
	this.caller = caller;
    }

    public final TodoDeque getOwnerDeque() {
	return this.ownerDeque;
    }

    public final void setOwnerDeque(TodoDeque ownerDeque) {
	if ( this.ownerDeque != null )
	    throw new IllegalStateException("item already owned by a deque");
	this.ownerDeque = ownerDeque;
    }

    public abstract void handle();

}