Package com.stardog.stark.util
Class ValueWeigher<K>
- java.lang.Object
-
- com.stardog.stark.util.ValueWeigher<K>
-
- All Implemented Interfaces:
com.google.common.cache.Weigher<K,Value>
public final class ValueWeigher<K> extends java.lang.Object implements com.google.common.cache.Weigher<K,Value>
Implementation of the Guava cache
Weigher
interface which will calculate the weight for aValue
based on how much space is takes in memory.- Since:
- 5.1.1
- Version:
- 5.1.1
- Author:
- Evren Sirin
-
-
Field Summary
Fields Modifier and Type Field Description static int
ARRAY_OVERHEAD
static int
BNODE_OVERHEAD
static int
CAL_LITERAL_OVERHEAD
int
constantOverhead
static int
ENUM_OVERHEAD
static int
GUAVA_CACHE_ENTRY_OVERHEAD
static int
IRI_OVERHEAD
static int
LANG_LITERAL_OVERHEAD
static int
LITERAL_OVERHEAD
static int
OBJECT_OVERHEAD
static int
REF_OVERHEAD
static int
STRING_OVERHEAD
static int
TYPED_LITERAL_OVERHEAD
-
Constructor Summary
Constructors Constructor Description ValueWeigher(int keyOverhead)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
weigh(K key, Value value)
static int
weightOf(Value value)
-
-
-
Field Detail
-
OBJECT_OVERHEAD
public static final int OBJECT_OVERHEAD
- See Also:
- Constant Field Values
-
ENUM_OVERHEAD
public static final int ENUM_OVERHEAD
- See Also:
- Constant Field Values
-
REF_OVERHEAD
public static final int REF_OVERHEAD
- See Also:
- Constant Field Values
-
ARRAY_OVERHEAD
public static final int ARRAY_OVERHEAD
- See Also:
- Constant Field Values
-
STRING_OVERHEAD
public static final int STRING_OVERHEAD
- See Also:
- Constant Field Values
-
LITERAL_OVERHEAD
public static final int LITERAL_OVERHEAD
- See Also:
- Constant Field Values
-
TYPED_LITERAL_OVERHEAD
public static final int TYPED_LITERAL_OVERHEAD
- See Also:
- Constant Field Values
-
LANG_LITERAL_OVERHEAD
public static final int LANG_LITERAL_OVERHEAD
- See Also:
- Constant Field Values
-
CAL_LITERAL_OVERHEAD
public static final int CAL_LITERAL_OVERHEAD
- See Also:
- Constant Field Values
-
BNODE_OVERHEAD
public static final int BNODE_OVERHEAD
- See Also:
- Constant Field Values
-
IRI_OVERHEAD
public static final int IRI_OVERHEAD
- See Also:
- Constant Field Values
-
GUAVA_CACHE_ENTRY_OVERHEAD
public static final int GUAVA_CACHE_ENTRY_OVERHEAD
- See Also:
- Constant Field Values
-
constantOverhead
public final int constantOverhead
-
-