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

eu.interedition.text.h2.AnchorRelation Maven / Gradle / Ivy

The newest version!
package eu.interedition.text.h2;

import com.google.common.base.Objects;
import eu.interedition.text.Anchor;
import eu.interedition.text.Layer;
import eu.interedition.text.Text;
import eu.interedition.text.TextRange;

/**
 * @author Gregor Middell
 */
public class AnchorRelation extends Anchor {

    private final long id;

    public AnchorRelation(Layer text, TextRange range, long id) {
        super(text, range);
        this.id = id;
    }

    public long getId() {
        return id;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj != null && obj instanceof AnchorRelation) {
            return id == ((AnchorRelation) obj).id;
        }
        return super.equals(obj);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy