/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.38
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.sbml.libsbml;

/** 
 * Log of errors and other events encountered during SBML processing.
 * <p>
 * <em style='color: #555'>
This class of objects is defined by libSBML only and has no direct
equivalent in terms of SBML components.  This class is not prescribed by
the SBML specifications, although it is used to implement features
defined in SBML.
</em>

 * <p>
 * The error log is simply a list.  Each {@link SBMLDocument} maintains its own
 * {@link SBMLErrorLog}.  When a libSBML operation on SBML content results in an
 * error, or when there is something worth noting about the SBML content, 
 * the issue is reported as an {@link SBMLError} object stored in the {@link SBMLErrorLog}
 * list.
 * <p>
 * {@link SBMLErrorLog} is derived from XMLErrorLog, an object class that serves
 * exactly the same purpose but for the XML parsing layer.  XMLErrorLog
 * provides crucial methods such as {@link SBMLErrorLog#getNumErrors()} for
 * determining how many {@link SBMLError} or XMLError objects are in the log.
 * {@link SBMLErrorLog} inherits these methods.
 * <p>
 * The general approach to working with {@link SBMLErrorLog} in user programs
 * involves first obtaining a pointer to a log from a libSBML object such
 * as {@link SBMLDocument}.  Callers should then use {@link SBMLErrorLog#getNumErrors()}
 * to inquire how many objects there are in the list.  (The answer may be
 * 0.)  If there is at least one {@link SBMLError} object in the {@link SBMLErrorLog}
 * instance, callers can then iterate over the list using 
 * {@link SBMLErrorLog#getError(long n)}, using
 * methods on {@link SBMLError}  to find out the error code and associated
 * information such as the error severity, the message, and the line number
 * in the input. 
 * <p>
 * <p>
 * If you wish to simply print the error strings for a human to read, an
 * easier and more direct way might be to use {@link SBMLDocument#printErrors()}.
 */

public class SBMLErrorLog extends XMLErrorLog {
   private long swigCPtr;

   protected SBMLErrorLog(long cPtr, boolean cMemoryOwn)
   {
     super(libsbmlJNI.SWIGSBMLErrorLogUpcast(cPtr), cMemoryOwn);
     swigCPtr = cPtr;
   }

   protected static long getCPtr(SBMLErrorLog obj)
   {
     return (obj == null) ? 0 : obj.swigCPtr;
   }

   protected static long getCPtrAndDisown (SBMLErrorLog obj)
   {
     long ptr = 0;

     if (obj != null)
     {
       ptr             = obj.swigCPtr;
       obj.swigCMemOwn = false;
     }

     return ptr;
   }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      libsbmlJNI.delete_SBMLErrorLog(swigCPtr);
    }
    swigCPtr = 0;
    super.delete();
  }

  
  /**
   * Returns the nth {@link SBMLError} in this log.
   * <p>
   * Callers should first inquire about the number of items in the log by
   * using the {@link SBMLErrorLog#getNumErrors()} method.  (This method is
   * inherited from the parent class, XMLErrorLog).  Attempting to using an
   * error index number that exceed the number of errors in the log will
   * result in a NULL being returned.
   * <p>
   * @param n long number of the error to retrieve.
   * <p>
   * @return the <code>n</code>th {@link SBMLError} in this log.
   */
 public SBMLError getError(long n) {
    long cPtr = libsbmlJNI.SBMLErrorLog_getError(swigCPtr, this, n);
    return (cPtr == 0) ? null : new SBMLError(cPtr, false);
  }

  
  /**
   * Returns the number of errors that have been logged with the given
   * severity code.
   * <p>
   * LibSBML associates severity levels with every {@link SBMLError} object to
   * provide an indication of how serious the problem is.  Severities range
   * from informational diagnostics to fatal (irrecoverable) errors.  Given
   * an {@link SBMLError} object instance, a caller can interrogate it for its
   * severity level using methods such as {@link SBMLError#getSeverity()},
   * {@link SBMLError#isFatal()}, and so on.  The present method encapsulates
   * iteration and interrogation of all objects in an {@link SBMLErrorLog}, making
   * it easy to check for the presence of error objects with specific
   * severity levels.
   * <p>
   * @param severity a
   * value from the set of <code>LIBSBML_SEV_</code> constants defined by
   * the interface class <code><a
   * href='libsbmlConstants.html'>libsbmlConstants</a></code> 
   */
 public long getNumFailsWithSeverity(long severity) {
    return libsbmlJNI.SBMLErrorLog_getNumFailsWithSeverity(swigCPtr, this, severity);
  }

  
  /**
   * Creates a new, empty {@link SBMLErrorLog}.
   <p>
 * @deprecated libSBML internal
 */
 public SBMLErrorLog() {
    this(libsbmlJNI.new_SBMLErrorLog(), true);
  }

  
  /**
   * Convenience function that combines creating an {@link SBMLError} object and
   * adding it to the log.
   * <p>
   * @param errorId a long integer, the identification number of the error.
   * <p>
   * @param details a string containing additional details about the error.
   * If the error code in <code>errorId</code> is one that is recognized by {@link SBMLError},
   * the given message is <em>appended</em> to a predefined message associated
   * with the given code.  If the error code is not recognized, the message
   * is stored as-is as the text of the error.
   * <p>
   * @param line a long integer, the line number at which the error occured.
   * <p>
   * @param column a long integer, the column number at which the error occured.
   * <p>
   * @param severity an integer indicating severity of the error.
   * <p>
   * @param category an integer indicating the category to which the error
   * belongs.
   * <p>
   * @docnote The native C++ implementation of this method defines a
   * default argument value.  In the documentation generated for different
   * libSBML language bindings, you may or may not see corresponding
   * arguments in the method declarations.  For example, in Java, a default
   * argument is handled by declaring two separate methods, with one of
   * them having the argument and the other one lacking the argument.
   * However, the libSBML documentation will be <em>identical</em> for both
   * methods.  Consequently, if you are reading this and do not see an
   * argument even though one is described, please look for descriptions of
   * other variants of this method near where this one appears in the
   * documentation.
   <p>
 * @deprecated libSBML internal
 */
 public void logError(long errorId, long level, long version, String details, long line, long column, long severity, long category) {
    libsbmlJNI.SBMLErrorLog_logError__SWIG_0(swigCPtr, this, errorId, level, version, details, line, column, severity, category);
  }

  
  /**
   * Convenience function that combines creating an {@link SBMLError} object and
   * adding it to the log.
   * <p>
   * @param errorId a long integer, the identification number of the error.
   * <p>
   * @param details a string containing additional details about the error.
   * If the error code in <code>errorId</code> is one that is recognized by {@link SBMLError},
   * the given message is <em>appended</em> to a predefined message associated
   * with the given code.  If the error code is not recognized, the message
   * is stored as-is as the text of the error.
   * <p>
   * @param line a long integer, the line number at which the error occured.
   * <p>
   * @param column a long integer, the column number at which the error occured.
   * <p>
   * @param severity an integer indicating severity of the error.
   * <p>
   * @param category an integer indicating the category to which the error
   * belongs.
   * <p>
   * @docnote The native C++ implementation of this method defines a
   * default argument value.  In the documentation generated for different
   * libSBML language bindings, you may or may not see corresponding
   * arguments in the method declarations.  For example, in Java, a default
   * argument is handled by declaring two separate methods, with one of
   * them having the argument and the other one lacking the argument.
   * However, the libSBML documentation will be <em>identical</em> for both
   * methods.  Consequently, if you are reading this and do not see an
   * argument even though one is described, please look for descriptions of
   * other variants of this method near where this one appears in the
   * documentation.
   <p>
 * @deprecated libSBML internal
 */
 public void logError(long errorId, long level, long version, String details, long line, long column, long severity) {
    libsbmlJNI.SBMLErrorLog_logError__SWIG_1(swigCPtr, this, errorId, level, version, details, line, column, severity);
  }

  
  /**
   * Convenience function that combines creating an {@link SBMLError} object and
   * adding it to the log.
   * <p>
   * @param errorId a long integer, the identification number of the error.
   * <p>
   * @param details a string containing additional details about the error.
   * If the error code in <code>errorId</code> is one that is recognized by {@link SBMLError},
   * the given message is <em>appended</em> to a predefined message associated
   * with the given code.  If the error code is not recognized, the message
   * is stored as-is as the text of the error.
   * <p>
   * @param line a long integer, the line number at which the error occured.
   * <p>
   * @param column a long integer, the column number at which the error occured.
   * <p>
   * @param severity an integer indicating severity of the error.
   * <p>
   * @param category an integer indicating the category to which the error
   * belongs.
   * <p>
   * @docnote The native C++ implementation of this method defines a
   * default argument value.  In the documentation generated for different
   * libSBML language bindings, you may or may not see corresponding
   * arguments in the method declarations.  For example, in Java, a default
   * argument is handled by declaring two separate methods, with one of
   * them having the argument and the other one lacking the argument.
   * However, the libSBML documentation will be <em>identical</em> for both
   * methods.  Consequently, if you are reading this and do not see an
   * argument even though one is described, please look for descriptions of
   * other variants of this method near where this one appears in the
   * documentation.
   <p>
 * @deprecated libSBML internal
 */
 public void logError(long errorId, long level, long version, String details, long line, long column) {
    libsbmlJNI.SBMLErrorLog_logError__SWIG_2(swigCPtr, this, errorId, level, version, details, line, column);
  }

  
  /**
   * Convenience function that combines creating an {@link SBMLError} object and
   * adding it to the log.
   * <p>
   * @param errorId a long integer, the identification number of the error.
   * <p>
   * @param details a string containing additional details about the error.
   * If the error code in <code>errorId</code> is one that is recognized by {@link SBMLError},
   * the given message is <em>appended</em> to a predefined message associated
   * with the given code.  If the error code is not recognized, the message
   * is stored as-is as the text of the error.
   * <p>
   * @param line a long integer, the line number at which the error occured.
   * <p>
   * @param column a long integer, the column number at which the error occured.
   * <p>
   * @param severity an integer indicating severity of the error.
   * <p>
   * @param category an integer indicating the category to which the error
   * belongs.
   * <p>
   * @docnote The native C++ implementation of this method defines a
   * default argument value.  In the documentation generated for different
   * libSBML language bindings, you may or may not see corresponding
   * arguments in the method declarations.  For example, in Java, a default
   * argument is handled by declaring two separate methods, with one of
   * them having the argument and the other one lacking the argument.
   * However, the libSBML documentation will be <em>identical</em> for both
   * methods.  Consequently, if you are reading this and do not see an
   * argument even though one is described, please look for descriptions of
   * other variants of this method near where this one appears in the
   * documentation.
   <p>
 * @deprecated libSBML internal
 */
 public void logError(long errorId, long level, long version, String details, long line) {
    libsbmlJNI.SBMLErrorLog_logError__SWIG_3(swigCPtr, this, errorId, level, version, details, line);
  }

  
  /**
   * Convenience function that combines creating an {@link SBMLError} object and
   * adding it to the log.
   * <p>
   * @param errorId a long integer, the identification number of the error.
   * <p>
   * @param details a string containing additional details about the error.
   * If the error code in <code>errorId</code> is one that is recognized by {@link SBMLError},
   * the given message is <em>appended</em> to a predefined message associated
   * with the given code.  If the error code is not recognized, the message
   * is stored as-is as the text of the error.
   * <p>
   * @param line a long integer, the line number at which the error occured.
   * <p>
   * @param column a long integer, the column number at which the error occured.
   * <p>
   * @param severity an integer indicating severity of the error.
   * <p>
   * @param category an integer indicating the category to which the error
   * belongs.
   * <p>
   * @docnote The native C++ implementation of this method defines a
   * default argument value.  In the documentation generated for different
   * libSBML language bindings, you may or may not see corresponding
   * arguments in the method declarations.  For example, in Java, a default
   * argument is handled by declaring two separate methods, with one of
   * them having the argument and the other one lacking the argument.
   * However, the libSBML documentation will be <em>identical</em> for both
   * methods.  Consequently, if you are reading this and do not see an
   * argument even though one is described, please look for descriptions of
   * other variants of this method near where this one appears in the
   * documentation.
   <p>
 * @deprecated libSBML internal
 */
 public void logError(long errorId, long level, long version, String details) {
    libsbmlJNI.SBMLErrorLog_logError__SWIG_4(swigCPtr, this, errorId, level, version, details);
  }

  
  /**
   * Convenience function that combines creating an {@link SBMLError} object and
   * adding it to the log.
   * <p>
   * @param errorId a long integer, the identification number of the error.
   * <p>
   * @param details a string containing additional details about the error.
   * If the error code in <code>errorId</code> is one that is recognized by {@link SBMLError},
   * the given message is <em>appended</em> to a predefined message associated
   * with the given code.  If the error code is not recognized, the message
   * is stored as-is as the text of the error.
   * <p>
   * @param line a long integer, the line number at which the error occured.
   * <p>
   * @param column a long integer, the column number at which the error occured.
   * <p>
   * @param severity an integer indicating severity of the error.
   * <p>
   * @param category an integer indicating the category to which the error
   * belongs.
   * <p>
   * @docnote The native C++ implementation of this method defines a
   * default argument value.  In the documentation generated for different
   * libSBML language bindings, you may or may not see corresponding
   * arguments in the method declarations.  For example, in Java, a default
   * argument is handled by declaring two separate methods, with one of
   * them having the argument and the other one lacking the argument.
   * However, the libSBML documentation will be <em>identical</em> for both
   * methods.  Consequently, if you are reading this and do not see an
   * argument even though one is described, please look for descriptions of
   * other variants of this method near where this one appears in the
   * documentation.
   <p>
 * @deprecated libSBML internal
 */
 public void logError(long errorId, long level, long version) {
    libsbmlJNI.SBMLErrorLog_logError__SWIG_5(swigCPtr, this, errorId, level, version);
  }

  
  /**
   * Convenience function that combines creating an {@link SBMLError} object and
   * adding it to the log.
   * <p>
   * @param errorId a long integer, the identification number of the error.
   * <p>
   * @param details a string containing additional details about the error.
   * If the error code in <code>errorId</code> is one that is recognized by {@link SBMLError},
   * the given message is <em>appended</em> to a predefined message associated
   * with the given code.  If the error code is not recognized, the message
   * is stored as-is as the text of the error.
   * <p>
   * @param line a long integer, the line number at which the error occured.
   * <p>
   * @param column a long integer, the column number at which the error occured.
   * <p>
   * @param severity an integer indicating severity of the error.
   * <p>
   * @param category an integer indicating the category to which the error
   * belongs.
   * <p>
   * @docnote The native C++ implementation of this method defines a
   * default argument value.  In the documentation generated for different
   * libSBML language bindings, you may or may not see corresponding
   * arguments in the method declarations.  For example, in Java, a default
   * argument is handled by declaring two separate methods, with one of
   * them having the argument and the other one lacking the argument.
   * However, the libSBML documentation will be <em>identical</em> for both
   * methods.  Consequently, if you are reading this and do not see an
   * argument even though one is described, please look for descriptions of
   * other variants of this method near where this one appears in the
   * documentation.
   <p>
 * @deprecated libSBML internal
 */
 public void logError(long errorId, long level) {
    libsbmlJNI.SBMLErrorLog_logError__SWIG_6(swigCPtr, this, errorId, level);
  }

  
  /**
   * Convenience function that combines creating an {@link SBMLError} object and
   * adding it to the log.
   * <p>
   * @param errorId a long integer, the identification number of the error.
   * <p>
   * @param details a string containing additional details about the error.
   * If the error code in <code>errorId</code> is one that is recognized by {@link SBMLError},
   * the given message is <em>appended</em> to a predefined message associated
   * with the given code.  If the error code is not recognized, the message
   * is stored as-is as the text of the error.
   * <p>
   * @param line a long integer, the line number at which the error occured.
   * <p>
   * @param column a long integer, the column number at which the error occured.
   * <p>
   * @param severity an integer indicating severity of the error.
   * <p>
   * @param category an integer indicating the category to which the error
   * belongs.
   * <p>
   * @docnote The native C++ implementation of this method defines a
   * default argument value.  In the documentation generated for different
   * libSBML language bindings, you may or may not see corresponding
   * arguments in the method declarations.  For example, in Java, a default
   * argument is handled by declaring two separate methods, with one of
   * them having the argument and the other one lacking the argument.
   * However, the libSBML documentation will be <em>identical</em> for both
   * methods.  Consequently, if you are reading this and do not see an
   * argument even though one is described, please look for descriptions of
   * other variants of this method near where this one appears in the
   * documentation.
   <p>
 * @deprecated libSBML internal
 */
 public void logError(long errorId) {
    libsbmlJNI.SBMLErrorLog_logError__SWIG_7(swigCPtr, this, errorId);
  }

  
  /**
   * Convenience function that combines creating an {@link SBMLError} object and
   * adding it to the log.
   * <p>
   * @param errorId a long integer, the identification number of the error.
   * <p>
   * @param details a string containing additional details about the error.
   * If the error code in <code>errorId</code> is one that is recognized by {@link SBMLError},
   * the given message is <em>appended</em> to a predefined message associated
   * with the given code.  If the error code is not recognized, the message
   * is stored as-is as the text of the error.
   * <p>
   * @param line a long integer, the line number at which the error occured.
   * <p>
   * @param column a long integer, the column number at which the error occured.
   * <p>
   * @param severity an integer indicating severity of the error.
   * <p>
   * @param category an integer indicating the category to which the error
   * belongs.
   * <p>
   * @docnote The native C++ implementation of this method defines a
   * default argument value.  In the documentation generated for different
   * libSBML language bindings, you may or may not see corresponding
   * arguments in the method declarations.  For example, in Java, a default
   * argument is handled by declaring two separate methods, with one of
   * them having the argument and the other one lacking the argument.
   * However, the libSBML documentation will be <em>identical</em> for both
   * methods.  Consequently, if you are reading this and do not see an
   * argument even though one is described, please look for descriptions of
   * other variants of this method near where this one appears in the
   * documentation.
   <p>
 * @deprecated libSBML internal
 */
 public void logError() {
    libsbmlJNI.SBMLErrorLog_logError__SWIG_8(swigCPtr, this);
  }

  
  /**
   * Adds the given {@link SBMLError} to the log.
   * <p>
   * @param error {@link SBMLError}, the error to be logged.
   <p>
 * @deprecated libSBML internal
 */
 public void add(SBMLError error) {
    libsbmlJNI.SBMLErrorLog_add(swigCPtr, this, SBMLError.getCPtr(error), error);
  }

  
  /**
   * Removes an error having errorId from the {@link SBMLError} list.
   * <p>
   * Only the first item will be removed if there are multiple errors
   * with the given errorId.
   * <p>
   * @param errorId the error identifier of the error to be removed.
   <p>
 * @deprecated libSBML internal
 */
 public void remove(long errorId) {
    libsbmlJNI.SBMLErrorLog_remove(swigCPtr, this, errorId);
  }

}
