org.openstreetmap.atlas.utilities.maps.LongToBooleanMap Maven / Gradle / Ivy
package org.openstreetmap.atlas.utilities.maps;
import org.openstreetmap.atlas.utilities.arrays.BooleanArray;
import org.openstreetmap.atlas.utilities.arrays.LargeArray;
import org.openstreetmap.atlas.utilities.arrays.LongArray;
/**
* Large Map from Long to Boolean
*
* @author matthieun
*/
public class LongToBooleanMap extends LargeMap
{
private static final long serialVersionUID = 346161750484489066L;
/**
* @param maximumSize
* The maximum number of keys in the map
*/
public LongToBooleanMap(final long maximumSize)
{
super(maximumSize);
}
/**
* @param maximumSize
* The maximum number of keys in the map
* @param hashSize
* The size of the hash domain
*/
public LongToBooleanMap(final long maximumSize, final int hashSize)
{
super(maximumSize, hashSize);
}
/**
* @param name
* The name of the map
* @param maximumSize
* The maximum number of keys in the map
* @param hashSize
* The size of the hash domain
* @param keyMemoryBlockSize
* The initial memory allocation size for the keys sub arrays
* @param keySubArraySize
* The maximum size of a keys sub array
* @param valueMemoryBlockSize
* The initial memory allocation size for the values sub arrays
* @param valueSubArraySize
* The maximum size of a values sub array
*/
public LongToBooleanMap(final String name, final long maximumSize, final int hashSize,
final int keyMemoryBlockSize, final int keySubArraySize, final int valueMemoryBlockSize,
final int valueSubArraySize)
{
super(name, maximumSize, hashSize, keyMemoryBlockSize, keySubArraySize,
valueMemoryBlockSize, valueSubArraySize);
}
@Override
protected LargeArray createKeys(final int memoryBlockSize, final int subArraySize)
{
final LongArray result;
if (memoryBlockSize > 0 && subArraySize > 0)
{
result = new LongArray(this.getMaximumSize(), memoryBlockSize, subArraySize);
}
else
{
result = new LongArray(this.getMaximumSize());
}
result.withName(getName() + " - Keys");
return result;
}
@Override
protected LargeArray createValues(final int memoryBlockSize, final int subArraySize)
{
final BooleanArray result;
if (memoryBlockSize > 0 && subArraySize > 0)
{
result = new BooleanArray(this.getMaximumSize(), memoryBlockSize, subArraySize);
}
else
{
result = new BooleanArray(this.getMaximumSize());
}
result.withName(getName() + " - Values");
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy