Top Description Inners Fields Constructors Methods
com.sun.star.lib.uno.protocols.urp

pack-priv final Class Cache

extends Object
Class Inheritance
Imports
java.util.HashMap

An LRU cache for arbitrary objects.

This class is not synchronized, as any necessary synchronization will already take place in the client.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private Cache.Entry
private Cache.Entry
private final HashMap<Object, Cache.Entry>
private final int
public static final int

Constructor Summary

AccessConstructor and Description
public
Cache(int
the maximum cache size, must be between 0, inclusive, and NOT_CACHED, exclusive.
size
)

Create a cache.

Method Summary

Modifier and TypeMethod and Description
public int
add(boolean[] found, Object content)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

firstback to summary
private Cache.Entry first
lastback to summary
private Cache.Entry last
mapback to summary
private final HashMap<Object, Cache.Entry> map
maxSizeback to summary
private final int maxSize
NOT_CACHEDback to summary
public static final int NOT_CACHED

Constructor Detail

Cacheback to summary
public Cache(int size)

Create a cache.

Parameters
size:int

the maximum cache size, must be between 0, inclusive, and NOT_CACHED, exclusive.

Method Detail

addback to summary
public int add(boolean[] found, Object content)
com.sun.star.lib.uno.protocols.urp back to summary

private final Class Cache.Entry

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public Object
public int
public Cache.Entry
public Cache.Entry

Constructor Summary

AccessConstructor and Description
public
Entry(Object content, int index, Cache.Entry prev, Cache.Entry next)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contentback to summary
public Object content
indexback to summary
public int index
nextback to summary
public Cache.Entry next
prevback to summary
public Cache.Entry prev

Constructor Detail

Entryback to summary
public Entry(Object content, int index, Cache.Entry prev, Cache.Entry next)