Package peak.can

Class MutableLong


  • public class MutableLong
    extends java.lang.Object
    The MutableInteger class wraps a value of the primitive type int in an object. An object of type Integer contains a single field whose type is int. This class is used because Java.Lang.Integer objects are defined as Imutable. Yet, we need to maintain object reference when it's passed to the JNI library using. So, we defined a simple Class which extends Java.Lang.Object to resolve the problematic.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      long value  
    • Constructor Summary

      Constructors 
      Constructor Description
      MutableLong​(long value)
      Constructor
      MutableLong​(java.lang.String value)
      Constructor parsing the string argument as a integer
    • Method Summary

      Modifier and Type Method Description
      long getValue()
      Gets integer value
      void setValue​(long value)
      Sets integer value
      java.lang.String toString()
      Overrides toString() to display int value
      • Methods inherited from class java.lang.Object

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

      • value

        public long value
    • Constructor Detail

      • MutableLong

        public MutableLong​(long value)
        Constructor
        Parameters:
        value - int value
      • MutableLong

        public MutableLong​(java.lang.String value)
        Constructor parsing the string argument as a integer
        Parameters:
        value - long as string
    • Method Detail

      • getValue

        public long getValue()
        Gets integer value
        Returns:
        integer value
      • setValue

        public void setValue​(long value)
        Sets integer value
        Parameters:
        value - Integer value
      • toString

        public java.lang.String toString()
        Overrides toString() to display int value
        Overrides:
        toString in class java.lang.Object
        Returns:
        MutableInteger's value as a string