public abstract class

SnmpListTableCache

extends SnmpTableCache
java.lang.Object
   ↳ sun.management.snmp.util.SnmpTableCache
     ↳ sun.management.snmp.util.SnmpListTableCache
Known Direct Subclasses

Class Overview

This abstract class implements a weak cache for a table whose data is obtained from a List.

NOTE: This class is not synchronized, subclasses must implement the appropriate synchronization whwn needed.

Summary

[Expand]
Inherited Fields
From class sun.management.snmp.util.SnmpTableCache
Public Constructors
SnmpListTableCache()
Protected Methods
Object getData(Object context, List rawDatas, int rank, Object item)
The data for the entry corresponding to the given item.
abstract SnmpOid getIndex(Object context, List rawDatas, int rank, Object item)
The index of the entry corresponding to the given item.
SnmpCachedData updateCachedDatas(Object context, List rawDatas)
Recompute cached data.
[Expand]
Inherited Methods
From class sun.management.snmp.util.SnmpTableCache
From class java.lang.Object

Public Constructors

public SnmpListTableCache ()

Protected Methods

protected Object getData (Object context, List rawDatas, int rank, Object item)

The data for the entry corresponding to the given item.
This method is called by updateCachedDatas(Object, List).

Parameters
context The context passed to updateCachedDatas(Object, List).
rawDatas Raw table datas passed to updateCachedDatas(Object, List).
rank Rank of the given item in the rawDatas list iterator.
item The raw data object from which the entry data must be extracted.
Returns
  • By default item is returned.

protected abstract SnmpOid getIndex (Object context, List rawDatas, int rank, Object item)

The index of the entry corresponding to the given item.
This method is called by updateCachedDatas(Object, List). The given item is expected to be always associated with the same index.

Parameters
context The context passed to updateCachedDatas(Object, List).
rawDatas Raw table datas passed to updateCachedDatas(Object, List).
rank Rank of the given item in the rawDatas list iterator.
item The raw data object for which an index must be determined.

protected SnmpCachedData updateCachedDatas (Object context, List rawDatas)

Recompute cached data.

Parameters
context A context object, valid during the duration of of the call to this method, and that will be passed to getIndex(Object, List, int, Object) and getData(Object, List, int, Object).
This method is intended to be called by updateCachedDatas(Object). It is assumed that the context is be allocated by before this method is called, and released just after this method has returned.
This class does not use the context object: it is a simple hook for subclassed.
rawDatas The table datas from which the cached data will be computed.
Returns
  • the computed cached data.