public class

SnmpCachedData

extends Object
implements SnmpTableHandler
java.lang.Object
   ↳ sun.management.snmp.util.SnmpCachedData
Known Direct Subclasses

Class Overview

This class is used to cache table data.

Summary

Fields
public final Object[] datas The table datas, sorted according to the order in indexes: datas[i] is the data that corresponds to indexes[i]
public final SnmpOid[] indexes The table entry indexes, sorted in ascending order.
public final long lastUpdated Time stamp as returned by System.currentTimeMillis()
public static final Comparator<SnmpOid> oidComparator Compares two SnmpOid.
Public Constructors
SnmpCachedData(long lastUpdated, SnmpOid[] indexes, Object[] datas)
Constructs a new instance of SnmpCachedData.
SnmpCachedData(long lastUpdated, TreeMap<SnmpOid, Object> indexMap)
Constructs a new instance of SnmpCachedData.
SnmpCachedData(long lastUpdated, TreeMap<SnmpOid, Object> indexMap, boolean b)
Constructs a new instance of SnmpCachedData.
Public Methods
boolean contains(SnmpOid index)
Returns true if the given index is present.
final int find(SnmpOid index)
The position of the given index, as returned by java.util.Arrays.binarySearch()
Object getData(SnmpOid index)
Returns the data associated with the given index.
SnmpOid getNext(SnmpOid index)
Returns the index that immediately follows the given index.
[Expand]
Inherited Methods
From class java.lang.Object
From interface sun.management.snmp.util.SnmpTableHandler

Fields

public final Object[] datas

The table datas, sorted according to the order in indexes: datas[i] is the data that corresponds to indexes[i]

public final SnmpOid[] indexes

The table entry indexes, sorted in ascending order.

public final long lastUpdated

Time stamp as returned by System.currentTimeMillis()

public static final Comparator<SnmpOid> oidComparator

Compares two SnmpOid.

Public Constructors

public SnmpCachedData (long lastUpdated, SnmpOid[] indexes, Object[] datas)

Constructs a new instance of SnmpCachedData. Instances are immutable.

Parameters
lastUpdated Time stamp as returned by System.currentTimeMillis()
indexes The table entry indexes, sorted in ascending order.
datas The table datas, sorted according to the order in indexes: datas[i] is the data that corresponds to indexes[i]

public SnmpCachedData (long lastUpdated, TreeMap<SnmpOid, Object> indexMap)

Constructs a new instance of SnmpCachedData. Instances are immutable.

Parameters
lastUpdated Time stamp as returned by System.currentTimeMillis()
indexMap The table indexed table data, sorted in ascending order by oidComparator. The keys must be instances of SnmpOid.

public SnmpCachedData (long lastUpdated, TreeMap<SnmpOid, Object> indexMap, boolean b)

Constructs a new instance of SnmpCachedData. Instances are immutable.

Parameters
lastUpdated Time stamp as returned by System.currentTimeMillis()
indexMap The table indexed table data, sorted in ascending order by oidComparator. The keys must be instances of SnmpOid.

Public Methods

public boolean contains (SnmpOid index)

Returns true if the given index is present.

public final int find (SnmpOid index)

The position of the given index, as returned by java.util.Arrays.binarySearch()

public Object getData (SnmpOid index)

Returns the data associated with the given index. If the given index is not found, null is returned. Note that returning null does not necessarily means that the index was not found.

public SnmpOid getNext (SnmpOid index)

Returns the index that immediately follows the given index. The returned index is strictly greater than the given index, and is contained in the table.
If the given index is null, returns the first index in the table.
If there are no index after the given index, returns null.