com.cisco.provisioning.cpe.api
Class SnmpVarList

java.lang.Object
  extended by com.cisco.provisioning.cpe.api.SnmpVarList
All Implemented Interfaces:
Externalizable, Serializable

public final class SnmpVarList
extends Object
implements Externalizable

Class to encapsulate a list of SnmpVariable objects, where each element of list contains name/value/type.

See Also:
Serialized Form

Constructor Summary
SnmpVarList()
          Constructor.
 
Method Summary
 void add(SnmpVariable var)
          Add an SnmpVariable to the internal list of vars.
 SnmpVariable get(int index)
          Returns the snmp variable at location pointed to by index.
 void readExternal(ObjectInput in)
          Externalizable interface.
 int size()
          Returns the number of Snmp variables in the list.
 String toString()
          Creates String representation of internal state.
 void writeExternal(ObjectOutput out)
          Externalizable interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpVarList

public SnmpVarList()
Constructor.

Method Detail

add

public void add(SnmpVariable var)
Add an SnmpVariable to the internal list of vars.

Parameters:
var - represents the snmp variable.

size

public int size()
Returns the number of Snmp variables in the list.

Returns:
the size of the list.

get

public SnmpVariable get(int index)
Returns the snmp variable at location pointed to by index.

Parameters:
index - refers to location in list.

Returns:
the SnmpVariable, or null if one not found.

toString

public String toString()
Creates String representation of internal state.

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

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Externalizable interface. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Specified by:
readExternal in interface Externalizable
Parameters:
in - the stream to read data from in order to restore the object
Throws:
IOException - if I/O errors occur
ClassNotFoundException - If the class for an object being restored cannot be found.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Externalizable interface. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Specified by:
writeExternal in interface Externalizable
Parameters:
out - the stream to write the object to

Throws:
IOException - Includes any I/O exceptions that may occur