// Path: pdfparse-lib/src/main/java/org/pdfparse/exception/EGenericException.java
// public class EGenericException extends RuntimeException {
//     /**
//      * Creates a new instance of
//      * <code>EGenericException</code> without detail message.
//      */
//     public EGenericException() {
//         super();
//     }
// 
//     /**
//      * Constructs an instance of
//      * <code>EGenericException</code> with the specified detail message.
//      *
//      * @param msg the detail message.
//      */
//     public EGenericException(String msg) {
//         super(msg);
//     }
// 
//     public EGenericException(Throwable cause) {
//         super(cause);
//     }
// 
//     public EGenericException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public EGenericException(String msg, Object... args) {
//         super(String.format(msg, args));
//     }
// }


import org.pdfparse.cos.*;
import org.pdfparse.exception.EGenericException;
import org.pdfparse.exception.EParseError;
import org.pdfparse.utils.IntObjHashtable;
        } else {
            Diagnostics.debugMessage(settings, "XREF: Got containerId which is zero. Assumed that this was a free object (%d 0 R)", id);
        }
    }

    public void setParser(ObjectParser parser) {
        this.parser = parser;
    }

    @Override
    public COSObject getObject(COSReference ref) {
        XRefEntry x = this.get(ref.id);

        if (x == null) {
            Diagnostics.debugMessage(settings, "No XRef entry for object %d %d R. Used COSNull instead", ref.id, ref.gen);
            return new COSNull();
        }

        if (x.gen != ref.gen) {
            Diagnostics.debugMessage(settings, "Object %s not found. But there is object with %d generation number", ref, x.gen);
        }

        if (x.cachedObject != null) {
            return x.cachedObject;
        }

        if (parser != null) {
            return parser.getObject(x);
        }

// Path: pdfparse-lib/src/main/java/org/pdfparse/exception/EGenericException.java
// public class EGenericException extends RuntimeException {
//     /**
//      * Creates a new instance of
//      * <code>EGenericException</code> without detail message.
//      */
//     public EGenericException() {
//         super();
//     }
// 
//     /**
//      * Constructs an instance of
//      * <code>EGenericException</code> with the specified detail message.
//      *
//      * @param msg the detail message.
//      */
//     public EGenericException(String msg) {
//         super(msg);
//     }
// 
//     public EGenericException(Throwable cause) {
//         super(cause);
//     }
// 
//     public EGenericException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public EGenericException(String msg, Object... args) {
//         super(String.format(msg, args));
//     }
// }


// Path: pdfparse-lib/src/main/java/org/pdfparse/parser/XRefTable.java
import org.pdfparse.cos.*;
import org.pdfparse.exception.EGenericException;
import org.pdfparse.exception.EParseError;
import org.pdfparse.utils.IntObjHashtable;

        } else {
            Diagnostics.debugMessage(settings, "XREF: Got containerId which is zero. Assumed that this was a free object (%d 0 R)", id);
        }
    }

    public void setParser(ObjectParser parser) {
        this.parser = parser;
    }

    @Override
    public COSObject getObject(COSReference ref) {
        XRefEntry x = this.get(ref.id);

        if (x == null) {
            Diagnostics.debugMessage(settings, "No XRef entry for object %d %d R. Used COSNull instead", ref.id, ref.gen);
            return new COSNull();
        }

        if (x.gen != ref.gen) {
            Diagnostics.debugMessage(settings, "Object %s not found. But there is object with %d generation number", ref, x.gen);
        }

        if (x.cachedObject != null) {
            return x.cachedObject;
        }

        if (parser != null) {
            return parser.getObject(x);
        }

        throw new EGenericException("Trying to access %s. Object is not loaded/parsed yet", ref);