com.amx.duet.tools.net.snmp.api
Class SNMPSequence

java.lang.Object
  extended bycom.amx.duet.tools.net.snmp.api.SNMPObject
      extended bycom.amx.duet.tools.net.snmp.api.SNMPSequence
Direct Known Subclasses:
SNMPMessage, SNMPPDU, SNMPv1TrapPDU, SNMPv2BulkRequestPDU, SNMPVarBindList, SNMPVariablePair

public class SNMPSequence
extends SNMPObject

One of the most important SNMP classes. Represents a sequence of other SNMP data types. Virtually all compound structures are subclasses of SNMPSequence - for example, the top-level SNMPMessage, and the SNMPPDU it contains, are both just specializations of SNMPSequence. Sequences are frequently nested within other sequences.


Constructor Summary
SNMPSequence()
          Create a new empty sequence.
SNMPSequence(java.util.Vector v)
          Create a new SNMP sequence from the supplied Vector of SNMPObjects.
 
Method Summary
 void addSNMPObject(SNMPObject newObject)
          Add the SNMP object to the end of the sequence.
 SNMPObject getSNMPObjectAt(int index)
          Return the SNMP object at the specified index.
 java.lang.Object getValue()
          Returns a Vector containing the SNMPObjects in the sequence.
 void insertSNMPObjectAt(SNMPObject newObject, int index)
          Insert the SNMP object at the specified position in the sequence.
 void setValue(java.lang.Object newSequence)
          Used to set the contained SNMP objects from a supplied Vector.
 int size()
          Return the number of SNMPObjects contained in the sequence.
 java.lang.String toString()
          Return a sequence of representations of the contained objects, separated by spaces and enclosed in parentheses.
 
Methods inherited from class com.amx.duet.tools.net.snmp.api.SNMPObject
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SNMPSequence

public SNMPSequence()
Create a new empty sequence.


SNMPSequence

public SNMPSequence(java.util.Vector v)
             throws SNMPBadValueException
Create a new SNMP sequence from the supplied Vector of SNMPObjects.

Throws:
SNMPBadValueException - Thrown if non-SNMP object supplied in Vector v.
Method Detail

getValue

public java.lang.Object getValue()
Returns a Vector containing the SNMPObjects in the sequence.

Specified by:
getValue in class SNMPObject

setValue

public void setValue(java.lang.Object newSequence)
              throws SNMPBadValueException
Used to set the contained SNMP objects from a supplied Vector.

Specified by:
setValue in class SNMPObject
Throws:
SNMPBadValueException - Indicates an incorrect object type supplied, or that the supplied Vector contains non-SNMPObjects.

size

public int size()
Return the number of SNMPObjects contained in the sequence.


addSNMPObject

public void addSNMPObject(SNMPObject newObject)
Add the SNMP object to the end of the sequence.

Throws:
SNMPBadValueException - Relevant only in subclasses

insertSNMPObjectAt

public void insertSNMPObjectAt(SNMPObject newObject,
                               int index)
Insert the SNMP object at the specified position in the sequence.

Throws:
SNMPBadValueException - Relevant only in subclasses

getSNMPObjectAt

public SNMPObject getSNMPObjectAt(int index)
Return the SNMP object at the specified index. Indices are 0-based.


toString

public java.lang.String toString()
Return a sequence of representations of the contained objects, separated by spaces and enclosed in parentheses.

Specified by:
toString in class SNMPObject


Copyright © 2008 AMX LLC. All Rights Reserved.