com.sun.management.snmp
Class SnmpCounter64

java.lang.Object
  extended by com.sun.management.snmp.SnmpValue
      extended by com.sun.management.snmp.SnmpCounter64
All Implemented Interfaces:
SnmpDataTypeEnums, Serializable, Cloneable

public class SnmpCounter64
extends SnmpValue

Represents an SNMP 64bits counter.

Since:
Java DMK 5.1
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.sun.management.snmp.SnmpDataTypeEnums
ApplFlag, BitStringTag, BooleanTag, Counter64Tag, CounterTag, CtxtFlag, errEndOfMibViewTag, errNoSuchInstanceTag, errNoSuchObjectTag, GaugeTag, IntegerTag, IpAddressTag, NsapTag, NullTag, ObjectIdentiferTag, ObjectIdentifierTag, OctetStringTag, OpaqueTag, SequenceTag, TableTag, TimeticksTag, UintegerTag, UnknownSyntaxTag
 
Constructor Summary
SnmpCounter64(long v)
          Constructs a new SnmpCounter64 from the specified long value.
SnmpCounter64(Long v)
          Constructs a new SnmpCounter64 from the specified Long value.
SnmpCounter64(UnsignedLong v)
          Constructs a new SnmpCounter64 from the specified UnsignedLong value.
 
Method Summary
static void appendToOid(SnmpOid source, SnmpOid dest)
          Appends an SnmpOid representing an SnmpCounter64 to another OID.
 Object clone()
          Clones the SnmpCounter64 object, making a copy of its data.
 SnmpValue duplicate()
          Performs a clone action.
 String getTypeName()
          Returns a textual description of the type object.
 int intValue()
          Converts the counter value to its integer form.
 long longValue()
          Returns the counter value of this SnmpCounter64.
static int nextOid(long[] index, int start)
          Scans an index OID, skips the counter value and returns the position of the next value.
 Integer toInteger()
          Converts the counter value to its Integer form.
 Long toLong()
          Converts the counter value to its Long form.
 SnmpOid toOid()
          Converts the counter value to its SnmpOid form.
static SnmpOid toOid(long[] index, int start)
          Extracts the counter from an index OID and returns its value converted as an SnmpOid.
 String toString()
          Converts the counter value to its String form.
 UnsignedLong toUnsignedLong()
          Converts the counter value to its UnsignedLong form.
 
Methods inherited from class com.sun.management.snmp.SnmpValue
isEndOfMibViewValue, isNoSuchInstanceValue, isNoSuchObjectValue, toAsn1String
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpCounter64

public SnmpCounter64(long v)
              throws IllegalArgumentException
Constructs a new SnmpCounter64 from the specified long value.

Parameters:
v - The initialization value.
Throws:
IllegalArgumentException - The specified value is negative or larger than Long.MAX_VALUE.

SnmpCounter64

public SnmpCounter64(Long v)
              throws IllegalArgumentException
Constructs a new SnmpCounter64 from the specified Long value.

Parameters:
v - The initialization value.
Throws:
IllegalArgumentException - The specified value is negative or larger than Long.MAX_VALUE.

SnmpCounter64

public SnmpCounter64(UnsignedLong v)
              throws IllegalArgumentException
Constructs a new SnmpCounter64 from the specified UnsignedLong value.

Parameters:
v - The initialization value.
Throws:
IllegalArgumentException - The specified value is larger than Long.MAX_VALUE.
Method Detail

longValue

public long longValue()
Returns the counter value of this SnmpCounter64.

Returns:
The value.

toLong

public Long toLong()
Converts the counter value to its Long form.

Returns:
The Long representation of the value.

intValue

public int intValue()
Converts the counter value to its integer form.

Returns:
The integer representation of the value.

toUnsignedLong

public UnsignedLong toUnsignedLong()
Converts the counter value to its UnsignedLong form.

Returns:
The UnsignedLong representation of the value.

toInteger

public Integer toInteger()
Converts the counter value to its Integer form.

Returns:
The Integer representation of the value.

toString

public String toString()
Converts the counter value to its String form.

Overrides:
toString in class Object
Returns:
The String representation of the value.

toOid

public SnmpOid toOid()
Converts the counter value to its SnmpOid form.

Specified by:
toOid in class SnmpValue
Returns:
The OID representation of the value.

toOid

public static SnmpOid toOid(long[] index,
                            int start)
                     throws SnmpStatusException
Extracts the counter from an index OID and returns its value converted as an SnmpOid.

Parameters:
index - The index array.
start - The position in the index array.
Returns:
The OID representing the counter value.
Throws:
SnmpStatusException - There is no counter value available at the start position.

nextOid

public static int nextOid(long[] index,
                          int start)
                   throws SnmpStatusException
Scans an index OID, skips the counter value and returns the position of the next value.

Parameters:
index - The index array.
start - The position in the index array.
Returns:
The position of the next value.
Throws:
SnmpStatusException - There is no counter value available at the start position.

appendToOid

public static void appendToOid(SnmpOid source,
                               SnmpOid dest)
Appends an SnmpOid representing an SnmpCounter64 to another OID.

Parameters:
source - An OID representing an SnmpCounter64 value.
dest - Where source should be appended.

duplicate

public final SnmpValue duplicate()
Performs a clone action. This provides a workaround for the SnmpValue interface.

Specified by:
duplicate in class SnmpValue
Returns:
The SnmpValue clone.

clone

public final Object clone()
Clones the SnmpCounter64 object, making a copy of its data.

Overrides:
clone in class Object
Returns:
The object clone.

getTypeName

public final String getTypeName()
Returns a textual description of the type object.

Specified by:
getTypeName in class SnmpValue
Returns:
ASN.1 textual description.

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.