All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wings.plaf.css.AbstractUpdate Maven / Gradle / Ivy

The newest version!
package org.wings.plaf.css;

import org.wings.SComponent;
import org.wings.plaf.Update;

public abstract class AbstractUpdate implements Update {

	protected final COMPONENT_TYPE component;

	public AbstractUpdate(COMPONENT_TYPE component) {
        if (component == null)
            throw new IllegalArgumentException("Component must not be null!");

		this.component = component;
	}

	@Override
    public final COMPONENT_TYPE getComponent() {
		return component;
	}

    @Override
    public int getProperty() {
        return FINE_GRAINED_UPDATE;
    }

    @Override
    public int getPriority() {
        return 1;
    }

	@Override
    public abstract Handler getHandler();

    @Override
    public boolean equals(Object object) {
        if (object == this)
            return true;
        if (object == null || object.getClass() != this.getClass())
            return false;

        Update other = (Update) object;

        if (!component.equals(other.getComponent()))
            return false;
        if (this.getProperty() != other.getProperty())
            return false;
        return this.getPriority() == other.getPriority();

    }

    @Override
    public int hashCode() {
        int hashCode = 17;
        int dispersionFactor = 37;

        hashCode = hashCode * dispersionFactor + component.hashCode();
        hashCode = hashCode * dispersionFactor + this.getProperty();
        hashCode = hashCode * dispersionFactor + this.getPriority();

        return hashCode;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy