Package herddb.utils
Class Sized<O extends Comparable<O>>
- java.lang.Object
-
- herddb.utils.Sized<O>
-
- Type Parameters:
O-
- All Implemented Interfaces:
SizeAwareObject,Comparable<Sized<O>>
public final class Sized<O extends Comparable<O>> extends Object implements SizeAwareObject, Comparable<Sized<O>>
An utility class for wrap objects intoSizeAwareObjectinstances. It should used only for testing purposes.- Author:
- diego.salvi
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Sized<O> o)booleanequals(Object obj)longgetEstimatedSize()Returns an estimation of the heap size of this instance.inthashCode()StringtoString()static Sized<Integer>valueOf(Integer x)static Sized<Long>valueOf(Long x)static Sized<String>valueOf(String x)static <X extends Comparable<X>>
Sized<X>valueOf(X x)
-
-
-
Field Detail
-
dummy
public final O extends Comparable<O> dummy
-
size
public final long size
-
-
Method Detail
-
valueOf
public static <X extends Comparable<X>> Sized<X> valueOf(X x)
-
getEstimatedSize
public long getEstimatedSize()
Description copied from interface:SizeAwareObjectReturns an estimation of the heap size of this instance.- Specified by:
getEstimatedSizein interfaceSizeAwareObject- Returns:
- size estimation in bytes
-
compareTo
public int compareTo(Sized<O> o)
- Specified by:
compareToin interfaceComparable<O extends Comparable<O>>
-
-