// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) space 
// Source File Name:   ResultNotifyer.java

package lt.ktu.gmj.ui;

import java.util.Vector;
import lt.ktu.gmj.*;

public abstract class ResultNotifyer
    implements ResultRepository
{

    public synchronized void addObserver(ResultObserver resultobserver)
    {
        observers.addElement(resultobserver);
    }

    public synchronized void removeObserver(ResultObserver resultobserver)
    {
        observers.removeElement(resultobserver);
    }

    protected synchronized void fireNewResult()
    {
        for (int i = observers.size() - 1; i >= 0; i--)
            ((ResultObserver)observers.elementAt(i)).newResult(this);

    }

    protected synchronized void fireNewProgressResult()
    {
        for (int i = observers.size() - 1; i >= 0; i--)
            ((ResultObserver)observers.elementAt(i)).newProgressResult(this);

    }

    protected synchronized void fireFinalResult()
    {
        for (int i = observers.size() - 1; i >= 0; i--)
            ((ResultObserver)observers.elementAt(i)).finalResult(this);

    }

    protected synchronized void fireLogStarted()
    {
        for (int i = observers.size() - 1; i >= 0; i--)
            ((ResultObserver)observers.elementAt(i)).logStarted(this);

    }

    protected synchronized void fireLogDisposed()
    {
        for (int i = observers.size() - 1; i >= 0; i--)
            ((ResultObserver)observers.elementAt(i)).logDisposed(this);

    }

    public abstract int resultCount();

    public abstract Result resultAt(int i);

    public abstract int progressResultCount();

    public abstract Result progressResultAt(int i);

    public abstract Result lastResult();

    public abstract Task task();

    public abstract Method method();

    public abstract double minValue();

    public abstract double maxValue();

    public ResultNotifyer()
    {
        observers = new Vector();
    }

    private Vector observers;
}
