Package org.apache.datasketches.common
Enum ResizeFactor
- java.lang.Object
-
- java.lang.Enum<ResizeFactor>
-
- org.apache.datasketches.common.ResizeFactor
-
- All Implemented Interfaces:
Serializable
,Comparable<ResizeFactor>
public enum ResizeFactor extends Enum<ResizeFactor>
For the Families that accept this configuration parameter, it controls the size multiple that affects how fast the internal cache grows, when more space is required. See Resize Factor- Author:
- Lee Rhodes
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResizeFactor
getRF(int lg)
Returns the Resize Factor given the Log-base 2 of the Resize Factorint
getValue()
Returns the Resize Factorint
lg()
Returns the Log-base 2 of the Resize Factorstatic ResizeFactor
valueOf(String name)
Returns the enum constant of this type with the specified name.static ResizeFactor[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
X1
public static final ResizeFactor X1
Do not resize. Sketch will be configured to full size.
-
X2
public static final ResizeFactor X2
Resize factor is 2.
-
X4
public static final ResizeFactor X4
Resize factor is 4.
-
X8
public static final ResizeFactor X8
Resize factor is 8.
-
-
Method Detail
-
values
public static ResizeFactor[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ResizeFactor c : ResizeFactor.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ResizeFactor valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
lg
public int lg()
Returns the Log-base 2 of the Resize Factor- Returns:
- the Log-base 2 of the Resize Factor
-
getRF
public static ResizeFactor getRF(int lg)
Returns the Resize Factor given the Log-base 2 of the Resize Factor- Parameters:
lg
- a value between zero and 3, inclusive.- Returns:
- the Resize Factor given the Log-base 2 of the Resize Factor
-
getValue
public int getValue()
Returns the Resize Factor- Returns:
- the Resize Factor
-
-