PosnMarker.java 1.86 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.text;

import com.adobe.xfa.text.TextMarker;
import com.adobe.xfa.text.TextPosn;
import com.adobe.xfa.text.TextPosnBase;

class PosnMarker
extends TextPosn {
    private PosnMarker mpoMate = null;
    private TextMarker mpoMarker;

    PosnMarker(TextMarker poMarker) {
        this.mpoMarker = poMarker;
        this.position(1);
    }

    PosnMarker(TextPosnBase oSource, TextMarker poMarker, int ePosn) {
        super(oSource);
        this.mpoMarker = poMarker;
        this.setMarkerPosition(true);
        this.position(ePosn);
    }

    PosnMarker(TextPosnBase oSource, TextMarker poMarker) {
        this(oSource, poMarker, 1);
    }

    PosnMarker getMate() {
        return this.mpoMate;
    }

    @Override
    public boolean equals(Object object) {
        return super.equals(object);
    }

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

    void setMate(PosnMarker poMate) {
        this.mpoMate = poMate;
    }

    TextMarker getMarker() {
        return this.mpoMarker;
    }

    void setMarker(TextMarker poMarker) {
        this.mpoMarker = poMarker;
    }

    void setMarkerIndex(int nIndex) {
        this.index(nIndex);
        boolean bPrimary = true;
        if (this.mpoMate != null) {
            if (this.mpoMate.index() == this.index()) {
                return;
            }
            if (this.mpoMate.index() < this.index()) {
                bPrimary = false;
            }
        }
        if (bPrimary) {
            this.tighten(true);
            if (this.mpoMate != null && this.index() > this.mpoMate.index()) {
                this.index(this.mpoMate.index());
            }
        } else {
            this.tighten(false);
            if (this.index() < this.mpoMate.index()) {
                this.index(this.mpoMate.index());
            }
        }
    }
}