/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

package com.pullenti.unitext.internal.pdf;

public class PdfRealValue extends PdfObject {

    public String val;

    @Override
    public double getDouble() {
        double res;
        com.pullenti.unisharp.Outargwrapper<Double> wrapres236 = new com.pullenti.unisharp.Outargwrapper<Double>();
        boolean inoutres237 = com.pullenti.util.MiscHelper.tryParseDouble(val, wrapres236);
        res = (wrapres236.value != null ? wrapres236.value : 0);
        if (!inoutres237) 
            return 0.0;
        return res;
    }

    @Override
    public String toStringEx(int lev) {
        return val;
    }

    @Override
    public boolean isSimple(int lev) {
        return true;
    }

    @Override
    public void write(com.pullenti.unisharp.Stream s) {
        try {
            byte[] buf = com.pullenti.unisharp.Utils.encodeCharset(java.nio.charset.Charset.forName("ASCII"), val);
            s.write(buf, 0, buf.length);
        } catch (Exception ex123) {
        }
    }
    public PdfRealValue() {
        super();
    }
}
