Package com.tangosol.net.topic
Class BinaryElementCalculator
- java.lang.Object
-
- com.tangosol.net.topic.BinaryElementCalculator
-
- All Implemented Interfaces:
NamedTopic.ElementCalculator
public class BinaryElementCalculator extends Object implements NamedTopic.ElementCalculator
ANamedTopic.ElementCalculator
that calculates size of an element based on the size of the serialized binary value.- Since:
- 21.06
- Author:
- Jonathan Knight 2021.05.17
-
-
Field Summary
Fields Modifier and Type Field Description static BinaryElementCalculator
INSTANCE
A singleton instance ofBinaryElementCalculator
.
-
Constructor Summary
Constructors Constructor Description BinaryElementCalculator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
calculateUnits(Binary binElement)
Calculate cost for the specified element.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tangosol.net.topic.NamedTopic.ElementCalculator
getName
-
-
-
-
Field Detail
-
INSTANCE
public static final BinaryElementCalculator INSTANCE
A singleton instance ofBinaryElementCalculator
.
-
-
Method Detail
-
calculateUnits
public int calculateUnits(Binary binElement)
Description copied from interface:NamedTopic.ElementCalculator
Calculate cost for the specified element.- Specified by:
calculateUnits
in interfaceNamedTopic.ElementCalculator
- Parameters:
binElement
- the element value (in serialized Binary form) to evaluate for unit cost- Returns:
- an integer value 0 or greater, with a larger value signifying a higher cost
-
-