com.sun.jaw.snmp.agent
Class SnmpIndex

java.lang.Object
  |
  +--com.sun.jaw.snmp.agent.SnmpIndex

public class SnmpIndex
extends java.lang.Object
implements java.io.Serializable

The SnmpIndex class represents a SNMP index. A SnmpIndex is represented as a Vector of oid.

You should not need to use this class directly.

See Also:
Serialized Form

Constructor Summary
SnmpIndex(SnmpOid oid)
          Initializes a SnmpIndex using the specified Object identifier.
SnmpIndex(SnmpOid[] oidList)
          Initializes a SnmpIndex using a vector of Object identifier.
 
Method Summary
 int compareTo(SnmpIndex index)
          Compares two indexes.
 boolean equals(SnmpIndex index)
          Compares two indexes for equality.
 java.util.Vector getComponents()
          Gets the index as a vector of Object identifiers.
 int getNbComponents()
          Gets the number of object identifiers the index is made of.
 java.lang.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 a SnmpIndex using a vector of Object identifier.

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 a 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 java.util.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 java.lang.String toString()
Returns a String representation of the index. The different elements are separated by "//".
Returns:
A string representation of the index.
Overrides:
toString in class java.lang.Object