CosBoolean.java 1.53 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.internal.io.stream.OutputByteStream
 */
package com.adobe.internal.pdftoolkit.core.cos;

import com.adobe.internal.io.stream.OutputByteStream;
import com.adobe.internal.pdftoolkit.core.cos.CosDocument;
import com.adobe.internal.pdftoolkit.core.cos.CosObject;
import com.adobe.internal.pdftoolkit.core.cos.CosObjectInfo;
import com.adobe.internal.pdftoolkit.core.cos.CosScalar;
import com.adobe.internal.pdftoolkit.core.util.StringOps;
import java.io.IOException;

public class CosBoolean
extends CosScalar {
    private Boolean mValue;

    CosBoolean(CosDocument doc, boolean value, CosObjectInfo info) {
        super(doc, info);
        this.mValue = value;
    }

    CosBoolean(CosDocument doc, Boolean value, CosObjectInfo info) {
        super(doc, info);
        this.mValue = value;
    }

    public int getType() {
        return 2;
    }

    public boolean booleanValue() {
        return this.mValue;
    }

    public Object getValue() {
        return this.mValue;
    }

    void writeOut(OutputByteStream outStream, boolean inString, boolean inDebugMode) throws IOException {
        outStream.write(StringOps.toByteArray(this.mValue.toString()));
    }

    public boolean equals(CosObject value) {
        if (!(value instanceof CosBoolean) || value.getDocument() != this.getDocument()) {
            return false;
        }
        if (value == this) {
            return true;
        }
        return value.booleanValue() == this.booleanValue();
    }
}