src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java

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


  49      * @param u the units of measure attribute
  50      * @param v the variability attribute
  51      * @param supported support level indicator
  52      * @param lb the buffer containing the long instrument data.
  53      */
  54     public PerfLongMonitor(String name, Units u, Variability v,
  55                            boolean supported, LongBuffer lb) {
  56         super(name, u, v, supported);
  57         this.lb = lb;
  58     }
  59 
  60     /**
  61      * {@inheritDoc}
  62      * The object returned contains a Long object containing the
  63      * current value of the LongInstrument.
  64      *
  65      * @return Object - the current value of the the LongInstrument. The
  66      *                  return type is guaranteed to be of type Long.
  67      */
  68     public Object getValue() {
  69         return new Long(lb.get(0));
  70     }
  71 
  72     /**
  73      * Return the current value of the LongInstrument as an long.
  74      *
  75      * @return long - the current value of the LongInstrument
  76      */
  77     public long longValue() {
  78         return lb.get(0);
  79     }
  80 }


  49      * @param u the units of measure attribute
  50      * @param v the variability attribute
  51      * @param supported support level indicator
  52      * @param lb the buffer containing the long instrument data.
  53      */
  54     public PerfLongMonitor(String name, Units u, Variability v,
  55                            boolean supported, LongBuffer lb) {
  56         super(name, u, v, supported);
  57         this.lb = lb;
  58     }
  59 
  60     /**
  61      * {@inheritDoc}
  62      * The object returned contains a Long object containing the
  63      * current value of the LongInstrument.
  64      *
  65      * @return Object - the current value of the the LongInstrument. The
  66      *                  return type is guaranteed to be of type Long.
  67      */
  68     public Object getValue() {
  69         return Long.valueOf(lb.get(0));
  70     }
  71 
  72     /**
  73      * Return the current value of the LongInstrument as an long.
  74      *
  75      * @return long - the current value of the LongInstrument
  76      */
  77     public long longValue() {
  78         return lb.get(0);
  79     }
  80 }