HOME

com.ireasoning.protocol.snmp
Class VarBindContainer

java.lang.Object
  extended bycom.ireasoning.protocol.snmp.VarBindContainer
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SnmpPdu, SnmpV1Trap

public abstract class VarBindContainer
extends Object
implements Serializable

This class implements a container of SnmpVarBind instances.

See Also:
Serialized Form

Method Summary
 void addVarBind(SnmpVarBind varbind)
          Adds a new SnmpVarBind instance to this PDU.
 void addVarBinds(SnmpVarBind[] varbinds)
          Adds new SnmpVarBind instances to this PDU.
 void addVarBinds(SnmpVarBindList varbinds)
          Adds new SnmpVarBind instances to this PDU.
 SnmpVarBind getFirstVarBind()
          Returns the first element
 SnmpVarBind getLastVarBind()
          Returns the last element
 SnmpVarBind getVarBind(int index)
          Returns the varbind at the specified position in this container.
 int getVarBindCount()
          Returns the number of varbind contained in this object.
 SnmpVarBind[] getVarBinds()
          Returns varbind array
 void removeAllVarBinds()
          Removes all varbinds
 void removeAllVarBinds(int offset)
          Removes all varbinds starting from offset, inclusive.
 SnmpVarBind removeVarBind(int index)
           
 void setVarBinds(SnmpVarBind[] varbinds)
          Removes all old varbinds, and set new varbinds
 void setVarBinds(SnmpVarBindList varbinds)
          Removes all old varbinds, and set new varbinds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getVarBindCount

public int getVarBindCount()
Returns the number of varbind contained in this object.

Returns:
The number of varbind.

getLastVarBind

public SnmpVarBind getLastVarBind()
Returns the last element


getFirstVarBind

public SnmpVarBind getFirstVarBind()
Returns the first element


removeAllVarBinds

public void removeAllVarBinds()
Removes all varbinds


removeAllVarBinds

public void removeAllVarBinds(int offset)
Removes all varbinds starting from offset, inclusive.

Parameters:
offset - the starting index of varbinds to be removed
Throws:
IndexOutOfBoundsException - if offset is out of range (offset < 0 || offset >= getVarBindCount()).

removeVarBind

public SnmpVarBind removeVarBind(int index)
Parameters:
index - - the index of the element to removed.
Returns:
the element that was removed from the list.
Throws:
IndexOutOfBoundsException - if index is out of range (index < 0 || index >= getVarBindCount()).

getVarBind

public SnmpVarBind getVarBind(int index)
Returns the varbind at the specified position in this container.

Parameters:
index - - the index of the element to be retrieved.
Throws:
IndexOutOfBoundsException - if index is out of range (index < 0 || index >= getVarBindCount()).

getVarBinds

public SnmpVarBind[] getVarBinds()
Returns varbind array

Returns:
An array of the varbind contained in this object.

addVarBind

public void addVarBind(SnmpVarBind varbind)
Adds a new SnmpVarBind instance to this PDU. If passed varbind object is null, nothing is added.


addVarBinds

public void addVarBinds(SnmpVarBind[] varbinds)
Adds new SnmpVarBind instances to this PDU. If passed varbinds object is null, nothing is added.


addVarBinds

public void addVarBinds(SnmpVarBindList varbinds)
Adds new SnmpVarBind instances to this PDU. If passed varbinds object is null, nothing is added.


setVarBinds

public void setVarBinds(SnmpVarBind[] varbinds)
Removes all old varbinds, and set new varbinds


setVarBinds

public void setVarBinds(SnmpVarBindList varbinds)
Removes all old varbinds, and set new varbinds


HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.