Initializing help system before first use

XPRBexprContext

  • java.lang.Object
    • com.dashoptimization.XPRBexprContext
  • All Implemented Interfaces:
    java.lang.AutoCloseable


    public final class XPRBexprContext
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Simplified handling of native resources associated with XPRBexpr instances.

    This class is intended to be use in a way similar to this:

     try (XPRBprob prob = bcl.newProb("")) {
       try (XPRBexprContext context = new XPRBexprContext()) {
         ...
         // Code that creates XPRBexpr instances without explicitly close()ing them
         ...
       } // all XPRBexpr instances automatically closed here
     }
     

    Once an instance of XPRBexprContext is created, it tracks all XPRBexpr instances that are created on the same thread.

    If the XPRBexprContext instance is then eventually closed (by explicitly or implicitly calling close()), all the tracked XPRBexpr instances will be closed as well.

    There can be only one XPRBexprContext instance per thread. Creating a second one without first closing the first one will raise an exception.

    Function close() must be called on the same thread that created the XPRBexprContext instance.

    • Constructor Summary

      Constructor and Description
      XPRBexprContext()
      Create a new XPRBexprContext.
    • Method Summary

      Modifier and Type Method and Description
      void close()
      Release all tracked XPRBexpr instances and stop tracking on the current thread.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XPRBexprContext

        public XPRBexprContext()
        Create a new XPRBexprContext. Once such a context is created, it will track all XPRBexpr instances created on the same thread that created the XPRBexprContext. When close() is called on that instance then all tracked XPRBexpr instances will be closed as well. There can be only one XPRBexprContext instance per thread. Creating a second one before first closing the first one will raise an exception.
        Throws:
        java.lang.IllegalStateException - if there already is an XPRBexprContext for this thread.
    • Method Detail

      • close

        public void close()
        Release all tracked XPRBexpr instances and stop tracking on the current thread. This function must be invoked from the same thread that created this instance.
        Specified by:
        close in interface  java.lang.AutoCloseable

© 2001-2024 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.