/*
 * 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 PdfObject {

    public PdfFile sourceFile = null;

    public int id = 0;

    public int getWriteId() {
        if (m_WriteId == 0) 
            return id;
        return m_WriteId;
    }

    public int setWriteId(int value) {
        m_WriteId = value;
        return value;
    }


    private int m_WriteId;

    public short version = (short)0;

    public long writePos;

    public long readPos;

    public int readLen;

    public boolean deleted;

    public Object tag;

    public int tmpTag;

    public boolean isSimple(int lev) throws java.io.IOException {
        return false;
    }

    public String toStringEx(int lev) throws java.io.IOException {
        return "?";
    }

    @Override
    public String toString() {
        try {
            return this.toStringEx(0);
        } catch (Exception ex123) {
            return null;
        }
    }

    public void outHtml(StringBuilder res) throws java.io.IOException, Exception, java.io.FileNotFoundException {
        com.pullenti.util.MiscHelper.correctHtmlValue(res, this.toString(), false, false, false);
        this._outHtmlRefs(res);
    }

    protected void _outHtmlRefs(StringBuilder res) throws java.io.IOException {
        if (sourceFile == null || id == 0) 
            return;
        java.util.ArrayList<PdfObject> li = sourceFile.getAllWhoRefObject0(id);
        if (li.size() == 0) 
            return;
        res.append("<hr/><div>На данный объект ссылаются:</div><ul>");
        for (PdfObject v : li) {
            res.append("<li>");
            if (v.id > 0) 
                res.append("<a href=\"obj").append(v.id).append("\">");
            com.pullenti.util.MiscHelper.correctHtmlValue(res, v.toString(), false, false, false);
            if (v.id > 0) 
                res.append("</a>");
            res.append("</li>");
        }
        res.append("</ul>");
    }

    public double getDouble() throws java.io.IOException {
        return 0.0;
    }

    public void write(com.pullenti.unisharp.Stream s) throws java.io.IOException {
    }

    public void getAllReferences(java.util.ArrayList<PdfReference> refs, java.util.ArrayList<Integer> ids) throws java.io.IOException {
    }

    public void getAllWhoRefObject(int objId, PdfObject cur, java.util.ArrayList<PdfObject> res, java.util.ArrayList<Integer> ids) throws java.io.IOException {
    }
    public PdfObject() {
    }
}
