Class IntWrapper


  • public class IntWrapper
    extends java.lang.Object
    A mutable wrapper for the int primitive. Used when multiple return values are required from a function, and some are ints.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Constructor Summary

      Constructors 
      Constructor Description
      IntWrapper()
      Default constructor.
      IntWrapper​(int startval)
      This constructor sets the internal value to the passed value.
      IntWrapper​(java.lang.String data)
      Constructor that sets the wrapped integer to the int value of the string variable passed in.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getInt()
      getter method for the wrapped integer
      java.lang.String getString()
      Returns the wrapped integer as a String variable.
      void setInt​(int newval)
      setter method for the wrapped integer
      void setString​(java.lang.String val)
      Sets the wrapped integer to the integer representation of the string that is passed in.
      java.lang.String toString()
      Overrides toString on java.lang.Object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IntWrapper

        public IntWrapper()
        Default constructor. Sets the wrapped integer to 0.
      • IntWrapper

        public IntWrapper​(int startval)
        This constructor sets the internal value to the passed value.
        Parameters:
        startval - The initial value of the wrapped int.
      • IntWrapper

        public IntWrapper​(java.lang.String data)
        Constructor that sets the wrapped integer to the int value of the string variable passed in.
        Parameters:
        data - This argument will be converted to an integer and the wrapped int will be set to it. The wrapped int will be set to 0 instead if it cannot be converted into an integer.
    • Method Detail

      • getInt

        public int getInt()
        getter method for the wrapped integer
        Returns:
        Value of wrapped integer.
      • getString

        public java.lang.String getString()
        Returns the wrapped integer as a String variable.
        Returns:
        Value of the wrapped integer in String form.
      • setInt

        public void setInt​(int newval)
        setter method for the wrapped integer
        Parameters:
        newval - The value that the wrapped integer will be set to.
      • setString

        public void setString​(java.lang.String val)
        Sets the wrapped integer to the integer representation of the string that is passed in.
        Parameters:
        val - The value that the wrapped integer will be set to. If this argument cannot be successfully be changed to an int, the wrapped integer will be set to 0.
      • toString

        public java.lang.String toString()
        Overrides toString on java.lang.Object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The internal integer in string format.