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

import com.adobe.xfa.text.DispLine;
import com.adobe.xfa.text.DispMapItem;
import com.adobe.xfa.text.TextPosn;
import com.adobe.xfa.text.TextPosnBase;
import com.adobe.xfa.text.TextStream;

class DispPosn
extends DispMapItem {
    private int mnStreamCount;
    private TextPosn moPosn;

    DispPosn() {
        this.mnStreamCount = 0;
    }

    DispPosn(DispPosn oSource) {
        super(oSource);
        this.moPosn = new TextPosn(oSource.moPosn);
        this.mnStreamCount = oSource.mnStreamCount;
    }

    DispPosn(DispPosn oSource, int index, int length) {
        super(index, length);
        this.moPosn = new TextPosn(oSource.moPosn);
        this.mnStreamCount = oSource.mnStreamCount;
    }

    DispPosn(TextPosn oSource) {
        this.moPosn = new TextPosn(oSource);
        this.mnStreamCount = 0;
    }

    DispPosn(TextPosnBase oSource) {
        this.moPosn = new TextPosn(oSource);
        this.mnStreamCount = 0;
    }

    DispPosn(TextStream poStream, int nIndex, int ePosn) {
        this.moPosn = new TextPosn(poStream, nIndex, ePosn);
        this.mnStreamCount = 0;
    }

    DispPosn(TextStream poStream, int nIndex) {
        this(poStream, nIndex, 0);
        this.mnStreamCount = 0;
    }

    @Override
    TextPosn pp() {
        return this.moPosn;
    }

    int getStreamCount() {
        return this.mnStreamCount;
    }

    void setStreamCount(int nStreamCount) {
        this.mnStreamCount = nStreamCount;
    }

    static void split(DispPosn oPosn, int nSplit) {
        oPosn.moPosn.index(oPosn.moPosn.index() + nSplit);
    }

    void copyFrom(DispPosn oSource) {
        super.copyFrom(oSource);
        this.moPosn = new TextPosn(oSource.moPosn);
        this.mnStreamCount = oSource.mnStreamCount;
    }

    void copyFrom(TextPosn oSource) {
        this.moPosn = new TextPosn(oSource);
        this.mnStreamCount = 0;
    }

    void copyFrom(TextPosnBase oSource) {
        this.moPosn = new TextPosn(oSource);
        this.mnStreamCount = 0;
    }

    @Override
    DispPosn p() {
        return this;
    }

    @Override
    void add(DispLine line, int start, int length) {
        line.add(this, start, length);
    }

    @Override
    DispMapItem cloneMapItem() {
        return new DispPosn(this);
    }

    @Override
    DispMapItem cloneMapItem(int index, int length) {
        return new DispPosn(this, index, length);
    }

    @Override
    void copyFrom(DispMapItem source) {
        assert (source instanceof DispPosn);
        this.copyFrom((DispPosn)source);
    }
}