1. /*
  2. * @(#)file SnmpCounter.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 4.8
  5. * @(#)date 04/09/15
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. package com.sun.jmx.snmp;
  12. /**
  13. * Represents an SNMP counter.
  14. *
  15. * <p><b>This API is a Sun Microsystems internal API and is subject
  16. * to change without notice.</b></p>
  17. * @version 4.8 12/19/03
  18. * @author Sun Microsystems, Inc
  19. */
  20. public class SnmpCounter extends SnmpUnsignedInt {
  21. // CONSTRUCTORS
  22. //-------------
  23. /**
  24. * Constructs a new <CODE>SnmpCounter</CODE> from the specified integer value.
  25. * @param v The initialization value.
  26. * @exception IllegalArgumentException The specified value is negative
  27. * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
  28. */
  29. public SnmpCounter(int v) throws IllegalArgumentException {
  30. super(v) ;
  31. }
  32. /**
  33. * Constructs a new <CODE>SnmpCounter</CODE> from the specified <CODE>Integer</CODE> value.
  34. * @param v The initialization value.
  35. * @exception IllegalArgumentException The specified value is negative
  36. * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
  37. */
  38. public SnmpCounter(Integer v) throws IllegalArgumentException {
  39. super(v) ;
  40. }
  41. /**
  42. * Constructs a new <CODE>SnmpCounter</CODE> from the specified long value.
  43. * @param v The initialization value.
  44. * @exception IllegalArgumentException The specified value is negative
  45. * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
  46. */
  47. public SnmpCounter(long v) throws IllegalArgumentException {
  48. super(v) ;
  49. }
  50. /**
  51. * Constructs a new <CODE>SnmpCounter</CODE> from the specified <CODE>Long</CODE> value.
  52. * @param v The initialization value.
  53. * @exception IllegalArgumentException The specified value is negative
  54. * or larger than {@link SnmpUnsignedInt#MAX_VALUE SnmpUnsignedInt.MAX_VALUE}.
  55. */
  56. public SnmpCounter(Long v) throws IllegalArgumentException {
  57. super(v) ;
  58. }
  59. // PUBLIC METHODS
  60. //---------------
  61. /**
  62. * Returns a textual description of the type object.
  63. * @return ASN.1 textual description.
  64. */
  65. final public String getTypeName() {
  66. return name ;
  67. }
  68. // VARIABLES
  69. //----------
  70. /**
  71. * Name of the type.
  72. */
  73. final static String name = "Counter32" ;
  74. }