Initializing help system before first use

XPRBindexSet

  • java.lang.Object
    • com.dashoptimization.XPRBindexSet


  • public class XPRBindexSet
    extends java.lang.Object
    This class represents an index set definition in BCL.
    • Method Summary

      Modifier and Type Method and Description
      int addElement(java.lang.String name)
      Add an index to an index set.
      int getIndex(java.lang.String name)
      Get the index number of an index.
      java.lang.String getIndexName(int i)
      Get the name of an index.
      java.lang.String getName()
      Get the name of an index set.
      int getSize()
      Get the size of an index set.
      boolean isValid()
      Test whether an index set is correctly defined.
      void print()
      Print out an index set.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • isValid

        public boolean isValid()
        Test whether an index set is correctly defined.
             XPRBindexSet iset;
             if(iset.isValid() == false)
                System.out.println("Error in index set definition.");
         
      • getName

        public java.lang.String getName()
        Get the name of an index set.
             XPRBprob expl2;
             XPRBindexSet iset;
             String name;
             expl2 = new XPRBprob("example2");
             iset = expl2.newIndexSet("Set",100);
             name = iset.getName();
         
        Returns:
        Name of the index set if method executed successfully, null otherwise
      • getSize

        public int getSize()
        Get the size of an index set. This method returns the current number of elements in an index set. This value does not necessarily correspond to the size specified at the creation of the set. The returned value may be smaller if fewer elements than the originally reserved number have been added, or larger if more elements have been added. (In the latter case, the size of the set is automatically increased.)
             XPRBprob expl2;
             XPRBindexSet iset;
             int size;
             expl2 = new XPRBprob("example2");
             iset = expl2.newIndexSet("Set",100);
             size = iset.getSize();
         
        Returns:
        Size (= number of elements) of the index set, -1 in case of an error
      • addElement

        public int addElement(java.lang.String name)
        Add an index to an index set. The index entry is only added to the set if no identical index already exists. Both in the case of a new set element and an existing one, the method returns the sequence number of the index in the index set. Note that the numbering of index elements starts with 0.
             XPRBprob expl2;
             XPRBindexSet iset;
             int val;
             expl2 = new XPRBprob("example2");
             iset = expl2.newIndexSet("Set",100);
             val = iset.addElement("first");
         
        Parameters:
        name - name of the index to be added to the set
        Returns:
        Sequence number of the index within the set, -1 in case of an error
      • getIndex

        public int getIndex(java.lang.String name)
        Get the index number of an index. An index element can be accessed either by its name or by its sequence number. This method returns the sequence number of an index given its name.
             XPRBprob expl2;
             XPRBindexSet iset;
             int val;
             expl2 = new XPRBprob("example2");
             iset = expl2.newIndexSet("Set",100);
             iset.addElement("first");
             val = iset.getIndex("first");
         
        Parameters:
        name - name of an index in the set
        Returns:
        Sequence number of the index within the set or -1 if not contained
      • getIndexName

        public java.lang.String getIndexName(int i)
        Get the name of an index. An index element can be accessed either by its name or by its sequence number. This method returns the name of an index set element given its sequence number.
             XPRBprob expl2;
             XPRBindexSet iset;
             String name;
             expl2 = new XPRBprob("example2");
             iset = expl2.newIndexSet("Set",100);
             iset.addElement("first");
             name = iset.getIndexName(0);
         
        Parameters:
        i - index number
        Returns:
        Name of the i th element in the set if method executed successfully, null otherwise
      • print

        public void print()
        Print out an index set. This method is not available in the Student Edition.
             XPRBprob expl2;
             XPRBindexSet iset;
             expl2 = new XPRBprob("example2");
             iset = expl2.newIndexSet("Set",100);
             iset.print();
         
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class  java.lang.Object
        See Also:
        getName()

© 2001-2025 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.