org.openstreetmap.atlas.utilities.arrays.IntegerArray Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of atlas Show documentation
Show all versions of atlas Show documentation
"Library to load OSM data into an Atlas format"
package org.openstreetmap.atlas.utilities.arrays;
/**
* {@link LargeArray} for type {@link Integer}
*
* @author matthieun
*/
public class IntegerArray extends LargeArray
{
/**
* {@link PrimitiveArray} for type {@link Integer}
*
* @author matthieun
*/
public static class IntegerPrimitiveArray extends PrimitiveArray
{
private static final long serialVersionUID = -3932998946137654750L;
private final int[] array = new int[size()];
public IntegerPrimitiveArray(final int size)
{
super(size);
}
@Override
public Integer get(final int index)
{
return this.array[index];
}
@Override
public PrimitiveArray getNewArray(final int size)
{
return new IntegerPrimitiveArray(size);
}
@Override
public void set(final int index, final Integer item)
{
this.array[index] = item;
}
}
private static final long serialVersionUID = -6015640040842668449L;
public IntegerArray(final long maximumSize)
{
super(maximumSize);
}
public IntegerArray(final long maximumSize, final int memoryBlockSize, final int subArraySize)
{
super(maximumSize, memoryBlockSize, subArraySize);
}
@Override
protected PrimitiveArray getNewArray(final int size)
{
return new IntegerPrimitiveArray(size);
}
}