src/share/classes/com/sun/jmx/snmp/SnmpCounter64.java

Print this page
rev 10195 : 8048267: Replace uses of 'new Long()' with appropriate alternative across core classes
Reviewed-by: chegar, psandoz
Contributed-by: Otavio Santana <otaviojava@java.net>


  67      */
  68     public SnmpCounter64(Long v) throws IllegalArgumentException {
  69         this(v.longValue()) ;
  70     }
  71 
  72     // PUBLIC METHODS
  73     //---------------
  74     /**
  75      * Returns the counter value of this <CODE>SnmpCounter64</CODE>.
  76      * @return The value.
  77      */
  78     public long longValue() {
  79         return value ;
  80     }
  81 
  82     /**
  83      * Converts the counter value to its <CODE>Long</CODE> form.
  84      * @return The <CODE>Long</CODE> representation of the value.
  85      */
  86     public Long toLong() {
  87         return new Long(value) ;
  88     }
  89 
  90     /**
  91      * Converts the counter value to its integer form.
  92      * @return The integer representation of the value.
  93      */
  94     public int intValue() {
  95         return (int)value ;
  96     }
  97 
  98     /**
  99      * Converts the counter value to its <CODE>Integer</CODE> form.
 100      * @return The <CODE>Integer</CODE> representation of the value.
 101      */
 102     public Integer toInteger() {
 103         return new Integer((int)value) ;
 104     }
 105 
 106     /**
 107      * Converts the counter value to its <CODE>String</CODE> form.




  67      */
  68     public SnmpCounter64(Long v) throws IllegalArgumentException {
  69         this(v.longValue()) ;
  70     }
  71 
  72     // PUBLIC METHODS
  73     //---------------
  74     /**
  75      * Returns the counter value of this <CODE>SnmpCounter64</CODE>.
  76      * @return The value.
  77      */
  78     public long longValue() {
  79         return value ;
  80     }
  81 
  82     /**
  83      * Converts the counter value to its <CODE>Long</CODE> form.
  84      * @return The <CODE>Long</CODE> representation of the value.
  85      */
  86     public Long toLong() {
  87         return value;
  88     }
  89 
  90     /**
  91      * Converts the counter value to its integer form.
  92      * @return The integer representation of the value.
  93      */
  94     public int intValue() {
  95         return (int)value ;
  96     }
  97 
  98     /**
  99      * Converts the counter value to its <CODE>Integer</CODE> form.
 100      * @return The <CODE>Integer</CODE> representation of the value.
 101      */
 102     public Integer toInteger() {
 103         return new Integer((int)value) ;
 104     }
 105 
 106     /**
 107      * Converts the counter value to its <CODE>String</CODE> form.