Interface MapToFactory
-
public interface MapToFactoryInterface for the factory design pattern for construction all AMapToData.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMapToFactory.MAP_TYPEThe different supported types of mappings.
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.LogLOG
-
Method Summary
Static Methods Modifier and Type Method Description static AMapToDatacreate(int[] values, int nUnique)Construct a mapping with the given values contained.static AMapToDatacreate(int[] values, MapToFactory.MAP_TYPE t)Create a specific mapping based on the integer values given.static AMapToDatacreate(int size, int unique)Create and allocate a map with the given size and support for up to the num tuples argument of valuesstatic AMapToDatacreate(int size, int[] values, int nUnique)Construct a mapping with the given values contained.static AMapToDatacreate(int size, int[] values, int nUnique, int k)static AMapToDatacreate(int size, MapToFactory.MAP_TYPE t)Allocate a specific type of map.static AMapToDatacreate(int unique, IntArrayList values)static longestimateInMemorySize(int size, int unique)Estimate the size in memory of a MapToFactory.static intgetMaxPossible(MapToFactory.MAP_TYPE t)Get the maximum value possible to encode in a specific mapping type.static AMapToDatareadIn(DataInput in)General interface to read in an AMapToData.static AMapToDataresizeForce(AMapToData d, MapToFactory.MAP_TYPE t)Force the mapping into an other mapping type.
-
-
-
Method Detail
-
create
static AMapToData create(int[] values, int nUnique)
Construct a mapping with the given values contained. The size is the length of the int array given.- Parameters:
values- The values contained.nUnique- The number of unique expected to be contained (is not verified.)- Returns:
- An appropriate AMapToData
-
create
static AMapToData create(int size, int[] values, int nUnique)
Construct a mapping with the given values contained. Only copies the values from the array given until size.- Parameters:
size- The number of elements to take from the values array.values- The values contained.nUnique- The number of unique expected to be contained (is not verified.)- Returns:
- An appropriate AMapToData
-
create
static AMapToData create(int unique, IntArrayList values)
-
create
static AMapToData create(int size, int[] values, int nUnique, int k) throws Exception
- Throws:
Exception
-
create
static AMapToData create(int size, int unique)
Create and allocate a map with the given size and support for up to the num tuples argument of values- Parameters:
size- The number of cells to allocateunique- The number of unique values to support (can encode unique -1)- Returns:
- A new map
-
create
static AMapToData create(int size, MapToFactory.MAP_TYPE t)
Allocate a specific type of map. Note that once in use it is recommended to set the number of unique values.- Parameters:
size- The size to allocatet- The mapping type.- Returns:
- An AMapToData allocation
-
create
static AMapToData create(int[] values, MapToFactory.MAP_TYPE t)
Create a specific mapping based on the integer values given. This constructor does not guarantee the values in the int array is encode-able in the given mapping.- Parameters:
values- The values to encode into the mappingt- The mapping type to use- Returns:
- The filled mapping with the values
-
resizeForce
static AMapToData resizeForce(AMapToData d, MapToFactory.MAP_TYPE t)
Force the mapping into an other mapping type. This method is unsafe since if there is overflows in the conversions, they are not handled. Also if the change is into the same type a new map is allocated anyway.- Parameters:
d- The map to resize.t- The type to resize to.- Returns:
- A new allocated mapToData with the specified type.
-
estimateInMemorySize
static long estimateInMemorySize(int size, int unique)Estimate the size in memory of a MapToFactory.- Parameters:
size- The size of the mappingunique- The number of unique values to support (can encode unique -1)- Returns:
- The size in number of bytes.
-
readIn
static AMapToData readIn(DataInput in) throws IOException
General interface to read in an AMapToData.- Parameters:
in- The data input to read from- Returns:
- The parsed AMapToData
- Throws:
IOException- If there is complications or errors in reading.
-
getMaxPossible
static int getMaxPossible(MapToFactory.MAP_TYPE t)
Get the maximum value possible to encode in a specific mapping type.- Parameters:
t- The mapping type to analyze- Returns:
- The maximum value to encode.
-
-