PosnStack.java 890 Bytes
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.text;

import com.adobe.xfa.text.TextPosn;
import com.adobe.xfa.text.TextPosnBase;
import com.adobe.xfa.ut.Storage;

class PosnStack
extends Storage<TextPosn> {
    static final long serialVersionUID = 4437578512627526202L;

    PosnStack() {
    }

    PosnStack(PosnStack source) {
        int depth = source.size();
        this.ensureCapacity(depth);
        for (int i = 0; i < depth; ++i) {
            this.add(new TextPosn((TextPosn)source.get(i)));
        }
    }

    TextPosn top() {
        return (TextPosn)this.last();
    }

    void push(TextPosnBase oPosn) {
        this.add(new TextPosn(oPosn));
    }

    TextPosnBase pop() {
        TextPosn oResult = null;
        if (this.size() > 0) {
            oResult = (TextPosn)this.last();
            this.removeLast();
        }
        return oResult;
    }
}