Weigher and EntryWeigher implementations.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static enum | |
| pack-priv static enum | |
| pack-priv static class | |
| pack-priv static enum | |
| pack-priv static enum | |
| pack-priv static enum | |
| pack-priv static enum | |
| pack-priv static enum | |
| pack-priv static enum |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <K, V> EntryWeigher | Returns: A entry weigher view of the specified weigher.the weigher to be "wrapped" in a entry weigher. weigher)A entry weigher backed by the specified weigher. |
| public static Weigher | Returns: A weigher where each byte takes one unit of capacity.A weigher where the value is a byte array and its weight is the number of bytes. |
| public static <E> Weigher | Returns: A weigher where each element takes one unit of capacity.A weigher where the value is a |
| public static <K, V> EntryWeigher | Returns: A weigher where a value takes one unit of capacity.A weigher where an entry has a weight of 1. |
| public static <E> Weigher | |
| public static <E> Weigher | |
| public static <A, B> Weigher | |
| public static <E> Weigher | |
| public static <V> Weigher | Returns: A weigher where a value takes one unit of capacity.A weigher where a value has a weight of 1. |
| Weighers | back to summary |
|---|---|
| private Weighers() | |
| asEntryWeigher | back to summary |
|---|---|
| public static <K, V> EntryWeigher A entry weigher backed by the specified weigher. The weight of the value determines the weight of the entry.
| |
| byteArray | back to summary |
|---|---|
| public static Weigher A weigher where the value is a byte array and its weight is the number of bytes. A map bounded with this weigher will evict when the number of bytes exceeds the capacity rather than the number of key-value pairs in the map. This allows for restricting the capacity based on the memory-consumption and is primarily for usage by dedicated caching servers that hold the serialized data. A value with a weight of 0 will be rejected by the map. If a value with this weight can occur then the caller should eagerly evaluate the value and treat it as a removal operation. Alternatively, a custom weigher may be specified on the map to assign an empty value a positive weight.
| |
| collection | back to summary |
|---|---|
| public static <E> Weigher A weigher where the value is a A value with a weight of 0 will be rejected by the map. If a value with this weight can occur then the caller should eagerly evaluate the value and treat it as a removal operation. Alternatively, a custom weigher may be specified on the map to assign an empty value a positive weight.
| |
| entrySingleton | back to summary |
|---|---|
| public static <K, V> EntryWeigher A weigher where an entry has a weight of 1. A map bounded with this weigher will evict when the number of key-value pairs exceeds the capacity.
| |
| iterable | back to summary |
|---|---|
| public static <E> Weigher A weigher where the value is a A value with a weight of 0 will be rejected by the map. If a value with this weight can occur then the caller should eagerly evaluate the value and treat it as a removal operation. Alternatively, a custom weigher may be specified on the map to assign an empty value a positive weight.
| |
| list | back to summary |
|---|---|
| public static <E> Weigher A weigher where the value is a A value with a weight of 0 will be rejected by the map. If a value with this weight can occur then the caller should eagerly evaluate the value and treat it as a removal operation. Alternatively, a custom weigher may be specified on the map to assign an empty value a positive weight.
| |
| map | back to summary |
|---|---|
| public static <A, B> Weigher A weigher where the value is a A value with a weight of 0 will be rejected by the map. If a value with this weight can occur then the caller should eagerly evaluate the value and treat it as a removal operation. Alternatively, a custom weigher may be specified on the map to assign an empty value a positive weight.
| |
| set | back to summary |
|---|---|
| public static <E> Weigher A weigher where the value is a A value with a weight of 0 will be rejected by the map. If a value with this weight can occur then the caller should eagerly evaluate the value and treat it as a removal operation. Alternatively, a custom weigher may be specified on the map to assign an empty value a positive weight.
| |
| singleton | back to summary |
|---|---|
| public static <V> Weigher A weigher where a value has a weight of 1. A map bounded with this weigher will evict when the number of key-value pairs exceeds the capacity.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Weighers. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Weighers. | |
| public static Weighers. | |
| public int | weightOf(byte[]
the object to weigh value)Implements org. |
| INSTANCE | back to summary |
|---|---|
| public static final Weighers. | |
| ByteArrayWeigher | back to summary |
|---|---|
| private ByteArrayWeigher() | |
| valueOf | back to summary |
|---|---|
| public static Weighers. | |
| values | back to summary |
|---|---|
| public static Weighers. | |
| weightOf | back to summary |
|---|---|
| public int weightOf(byte[] value) Implements org. Doc from org. Measures an object's weight to determine how many units of capacity that the value consumes. A value must consume a minimum of one unit.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Weighers. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Weighers. | |
| public static Weighers. | |
| public int | weightOf(Collection<?>
the object to weigh values)Implements org. |
| INSTANCE | back to summary |
|---|---|
| public static final Weighers. | |
| CollectionWeigher | back to summary |
|---|---|
| private CollectionWeigher() | |
| valueOf | back to summary |
|---|---|
| public static Weighers. | |
| values | back to summary |
|---|---|
| public static Weighers. | |
| weightOf | back to summary |
|---|---|
| public int weightOf(Collection<?> values) Implements org. Doc from org. Measures an object's weight to determine how many units of capacity that the value consumes. A value must consume a minimum of one unit.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long | |
| pack-priv final Weigher |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | weightOf(K
the key to weigh key, V the value to weigh value)Implements org. |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| weigher | back to summary |
|---|---|
| pack-priv final Weigher<? super V> weigher | |
| EntryWeigherView | back to summary |
|---|---|
| pack-priv EntryWeigherView(Weigher<? super V> weigher) | |
| weightOf | back to summary |
|---|---|
| public int weightOf(K key, V value) Implements org. Doc from org. Measures an entry's weight to determine how many units of capacity that the key and value consumes. An entry must consume a minimum of one unit.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Weighers. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Weighers. | |
| public static Weighers. | |
| public int | weightOf(Iterable<?>
the object to weigh values)Implements org. |
| INSTANCE | back to summary |
|---|---|
| public static final Weighers. | |
| IterableWeigher | back to summary |
|---|---|
| private IterableWeigher() | |
| valueOf | back to summary |
|---|---|
| public static Weighers. | |
| values | back to summary |
|---|---|
| public static Weighers. | |
| weightOf | back to summary |
|---|---|
| public int weightOf(Iterable<?> values) Implements org. Doc from org. Measures an object's weight to determine how many units of capacity that the value consumes. A value must consume a minimum of one unit. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Weighers. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Weighers. | |
| public static Weighers. | |
| public int | weightOf(List<?>
the object to weigh values)Implements org. |
| INSTANCE | back to summary |
|---|---|
| public static final Weighers. | |
| ListWeigher | back to summary |
|---|---|
| private ListWeigher() | |
| valueOf | back to summary |
|---|---|
| public static Weighers. | |
| values | back to summary |
|---|---|
| public static Weighers. | |
| weightOf | back to summary |
|---|---|
| public int weightOf(List<?> values) Implements org. Doc from org. Measures an object's weight to determine how many units of capacity that the value consumes. A value must consume a minimum of one unit. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Weighers. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Weighers. | |
| public static Weighers. | |
| public int | weightOf(Map<?, ?>
the object to weigh values)Implements org. |
| INSTANCE | back to summary |
|---|---|
| public static final Weighers. | |
| MapWeigher | back to summary |
|---|---|
| private MapWeigher() | |
| valueOf | back to summary |
|---|---|
| public static Weighers. | |
| values | back to summary |
|---|---|
| public static Weighers. | |
| weightOf | back to summary |
|---|---|
| public int weightOf(Map<?, ?> values) Implements org. Doc from org. Measures an object's weight to determine how many units of capacity that the value consumes. A value must consume a minimum of one unit. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Weighers. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Weighers. | |
| public static Weighers. | |
| public int | weightOf(Set<?>
the object to weigh values)Implements org. |
| INSTANCE | back to summary |
|---|---|
| public static final Weighers. | |
| SetWeigher | back to summary |
|---|---|
| private SetWeigher() | |
| valueOf | back to summary |
|---|---|
| public static Weighers. | |
| values | back to summary |
|---|---|
| public static Weighers. | |
| weightOf | back to summary |
|---|---|
| public int weightOf(Set<?> values) Implements org. Doc from org. Measures an object's weight to determine how many units of capacity that the value consumes. A value must consume a minimum of one unit. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Weighers. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Weighers. | |
| public static Weighers. | |
| public int | weightOf(Object
the key to weigh key, Object the value to weigh value)Implements org. |
| INSTANCE | back to summary |
|---|---|
| public static final Weighers. | |
| SingletonEntryWeigher | back to summary |
|---|---|
| private SingletonEntryWeigher() | |
| valueOf | back to summary |
|---|---|
| public static Weighers. | |
| values | back to summary |
|---|---|
| public static Weighers. | |
| weightOf | back to summary |
|---|---|
| public int weightOf(Object key, Object value) Implements org. Doc from org. Measures an entry's weight to determine how many units of capacity that the key and value consumes. An entry must consume a minimum of one unit. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Weighers. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Weighers. | |
| public static Weighers. | |
| public int | weightOf(Object
the object to weigh value)Implements org. |
| INSTANCE | back to summary |
|---|---|
| public static final Weighers. | |
| SingletonWeigher | back to summary |
|---|---|
| private SingletonWeigher() | |
| valueOf | back to summary |
|---|---|
| public static Weighers. | |
| values | back to summary |
|---|---|
| public static Weighers. | |
| weightOf | back to summary |
|---|---|
| public int weightOf(Object value) Implements org. Doc from org. Measures an object's weight to determine how many units of capacity that the value consumes. A value must consume a minimum of one unit. | |