com.sun.management.snmp.agent
Class SnmpIndex

java.lang.Object
  extended by com.sun.management.snmp.agent.SnmpIndex
All Implemented Interfaces:
Serializable

public class SnmpIndex
extends Object
implements Serializable

Represents a SNMP index. An SnmpIndex is represented as a Vector of SnmpOid.

This class is used internally and by the classes generated by mibgen. You should not need to use this class directly.

Since:
Java DMK 5.1
See Also:
Serialized Form

Constructor Summary
SnmpIndex(SnmpOid oid)
          Initializes an SnmpIndex using the specified Object Identifier.
SnmpIndex(SnmpOid[] oidList)
          Initializes an SnmpIndex using a vector of object identifiers.
 
Method Summary
 int compareTo(SnmpIndex index)
          Compares two indexes.
 boolean equals(SnmpIndex index)
          Compares two indexes for equality.
 Vector getComponents()
          Gets the index as a vector of Object Identifiers.
 int getNbComponents()
          Gets the number of Object Identifiers the index is made of.
 String toString()
          Returns a String representation of the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpIndex

public SnmpIndex(SnmpOid[] oidList)
Initializes an SnmpIndex using a vector of object identifiers.

Following the RFC recommendations, every syntax that is used as a table index should have an object identifier representation. There are some guidelines on how to map the different syntaxes into an object identifier. In the different SnmpValue classes provided, there is a toOid method to get the object identifier of the value.

Parameters:
oidList - The list of Object Identifiers.

SnmpIndex

public SnmpIndex(SnmpOid oid)
Initializes an SnmpIndex using the specified Object Identifier.

Parameters:
oid - The Object Identifier.
Method Detail

getNbComponents

public int getNbComponents()
Gets the number of Object Identifiers the index is made of.

Returns:
The number of Object Identifiers.

getComponents

public Vector getComponents()
Gets the index as a vector of Object Identifiers.

Returns:
The index as a vector.

equals

public boolean equals(SnmpIndex index)
Compares two indexes for equality.

Parameters:
index - The index to compare this with.
Returns:
true if the two indexes are equal, false otherwise.

compareTo

public int compareTo(SnmpIndex index)
Compares two indexes.

Parameters:
index - The index to compare this with.
Returns:
The value 0 if the two OID vectors have the same elements, another value otherwise.

toString

public String toString()
Returns a String representation of the index. The different elements are separated by "//".

Overrides:
toString in class Object
Returns:
A string representation of the index.

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.