/* ----------------------------------------------------------------------------
 * 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;

/** 
 * Methods for interacting with Systems Biology Ontology (%SBO) terms.
 * <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>
 */

public class SBO {
   private long swigCPtr;
   protected boolean swigCMemOwn;

   protected SBO(long cPtr, boolean cMemoryOwn)
   {
     swigCMemOwn = cMemoryOwn;
     swigCPtr    = cPtr;
   }

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

   protected static long getCPtrAndDisown (SBO 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_SBO(swigCPtr);
    }
    swigCPtr = 0;
  }

  
  /**
   * Reads (and checks) sboTerm from the given XMLAttributes set.
   * <p>
   * @return the sboTerm as an integer or -1 if the sboTerm was not in the
   * correct format or not found.
   <p>
 * @deprecated libSBML internal
 */
 public static int readTerm(XMLAttributes attributes, SBMLErrorLog log) {
    return libsbmlJNI.SBO_readTerm(XMLAttributes.getCPtr(attributes), attributes, SBMLErrorLog.getCPtr(log), log);
  }

  
  /**
   * Writes sboTerm as an XMLAttribute to the given XMLOutputStream.
   <p>
 * @deprecated libSBML internal
 */
 public static void writeTerm(XMLOutputStream stream, int sboTerm) {
    libsbmlJNI.SBO_writeTerm(XMLOutputStream.getCPtr(stream), stream, sboTerm);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a QuantitativeParameter, false otherwise
   */
 public static boolean isQuantitativeParameter(long term) {
    return libsbmlJNI.SBO_isQuantitativeParameter(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a ParticipantRole, false otherwise
   */
 public static boolean isParticipantRole(long term) {
    return libsbmlJNI.SBO_isParticipantRole(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a ModellingFramework, false otherwise
   */
 public static boolean isModellingFramework(long term) {
    return libsbmlJNI.SBO_isModellingFramework(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a MathematicalExpression, false otherwise
   */
 public static boolean isMathematicalExpression(long term) {
    return libsbmlJNI.SBO_isMathematicalExpression(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a KineticConstant, false otherwise
   */
 public static boolean isKineticConstant(long term) {
    return libsbmlJNI.SBO_isKineticConstant(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a Reactant, false otherwise
   */
 public static boolean isReactant(long term) {
    return libsbmlJNI.SBO_isReactant(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a Product, false otherwise
   */
 public static boolean isProduct(long term) {
    return libsbmlJNI.SBO_isProduct(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a Modifier, false otherwise
   */
 public static boolean isModifier(long term) {
    return libsbmlJNI.SBO_isModifier(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a RateLaw, false otherwise
   */
 public static boolean isRateLaw(long term) {
    return libsbmlJNI.SBO_isRateLaw(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a {@link Event}, false otherwise
   */
 public static boolean isEvent(long term) {
    return libsbmlJNI.SBO_isEvent(term);
  }

  
  /**
    * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
    * <p>
    * @return true if the term is-a PhysicalParticipant, false otherwise
    */
 public static boolean isPhysicalParticipant(long term) {
    return libsbmlJNI.SBO_isPhysicalParticipant(term);
  }

  
  /**
    * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
    * <p>
    * @return true if the term is-a Participant, false otherwise
    */
 public static boolean isParticipant(long term) {
    return libsbmlJNI.SBO_isParticipant(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a Interaction, false otherwise
   */
 public static boolean isInteraction(long term) {
    return libsbmlJNI.SBO_isInteraction(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a Entity, false otherwise
   */
 public static boolean isEntity(long term) {
    return libsbmlJNI.SBO_isEntity(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a FunctionalEntity, false otherwise
   */
 public static boolean isFunctionalEntity(long term) {
    return libsbmlJNI.SBO_isFunctionalEntity(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a MaterialEntity, false otherwise
   */
 public static boolean isMaterialEntity(long term) {
    return libsbmlJNI.SBO_isMaterialEntity(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a ConservationLaw, false otherwise
   */
 public static boolean isConservationLaw(long term) {
    return libsbmlJNI.SBO_isConservationLaw(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a SteadyStateExpression, false otherwise
   */
 public static boolean isSteadyStateExpression(long term) {
    return libsbmlJNI.SBO_isSteadyStateExpression(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a FunctionalCompartment, false otherwise
   */
 public static boolean isFunctionalCompartment(long term) {
    return libsbmlJNI.SBO_isFunctionalCompartment(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a ContinuousFramework, false otherwise
   */
 public static boolean isContinuousFramework(long term) {
    return libsbmlJNI.SBO_isContinuousFramework(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a DiscreteFramework, false otherwise
   */
 public static boolean isDiscreteFramework(long term) {
    return libsbmlJNI.SBO_isDiscreteFramework(term);
  }

  
  /**
   * Function for checking the {@link SBO} term is from correct part of {@link SBO}.
   * <p>
   * @return true if the term is-a LogicalFramework, false otherwise
   */
 public static boolean isLogicalFramework(long term) {
    return libsbmlJNI.SBO_isLogicalFramework(term);
  }

  
  /**
   * Function for checking whether the {@link SBO} term is obselete.
   * <p>
   * @return true if the term is-a Obsolete, false otherwise
   */
 public static boolean isObselete(long term) {
    return libsbmlJNI.SBO_isObselete(term);
  }

  
  /**
   * Returns the integer as a correctly formatted {@link SBO} string.
   * <p>
   * @return the given integer sboTerm as a zero-padded seven digit string.
   * <p>
   * @note If the sboTerm is not in the correct range ([0 -- 9999999]), an empty
   * string is returned.
   */
 public static String intToString(int sboTerm) {
    return libsbmlJNI.SBO_intToString(sboTerm);
  }

  public SBO() {
    this(libsbmlJNI.new_SBO(), true);
  }

}
