本文整理汇总了Java中it.unimi.dsi.fastutil.floats.FloatArrayList类的典型用法代码示例。如果您正苦于以下问题:Java FloatArrayList类的具体用法?Java FloatArrayList怎么用?Java FloatArrayList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FloatArrayList类属于it.unimi.dsi.fastutil.floats包,在下文中一共展示了FloatArrayList类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: end
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
@Override
public void end() {
if (elementClass == boolean.class) {
parent.add(((BooleanArrayList) container).toBooleanArray());
} else if (elementClass == byte.class) {
parent.add(((ByteArrayList) container).toByteArray());
} else if (elementClass == char.class) {
parent.add(((CharArrayList) container).toCharArray());
} else if (elementClass == short.class) {
parent.add(((ShortArrayList) container).toShortArray());
} else if (elementClass == int.class) {
parent.add(((IntArrayList) container).toIntArray());
} else if (elementClass == long.class) {
parent.add(((LongArrayList) container).toLongArray());
} else if (elementClass == float.class) {
parent.add(((FloatArrayList) container).toFloatArray());
} else if (elementClass == double.class) {
parent.add(((DoubleArrayList) container).toDoubleArray());
} else {
parent.add(((ArrayList) container).toArray());
}
}
示例2: build
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
public PairM<FloatList,FloatList> build(float x, float y, float size, char toBuild){
FloatList vert=new FloatArrayList(),uv=new FloatArrayList();
build(x, y, size, toBuild, (x0, z0)->{
vert.add(x0);
vert.add(z0);
}, (u, v)->{
uv.add(u);
uv.add(v);
});
return new PairM<>(vert, uv);
}
示例3: PerfQuery
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
/** Creates a new instance of PerfQuery */
public PerfQuery() {
results = new FloatArrayList[4];
results[BRUTE_FORCE] = new FloatArrayList();
results[HAND_CODED] = new FloatArrayList();
results[INDEXED] = new FloatArrayList();
results[INDEX_CREATE] = new FloatArrayList();
}
示例4: toFloatArray
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
public FloatArrayList toFloatArray() {
FloatArrayList output = new FloatArrayList(data.size());
for (long aData : data) {
output.add(aData);
}
return output;
}
示例5: toFloatArray
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
public FloatArrayList toFloatArray() {
FloatArrayList output = new FloatArrayList(data.size());
for (short aData : data) {
output.add(aData);
}
return output;
}
示例6: toFloatArray
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
public FloatArrayList toFloatArray() {
FloatArrayList output = new FloatArrayList(data.size());
for (int aData : data) {
output.add(aData);
}
return output;
}
示例7: join
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
/**
* Joins arrays together, if only one array contains elements it will be returned without coping anything. <br>
* If given array or arrays is empty, new empty array will be returned.
*
* @param arrays arrays to join.
*
* @return new joined array, or one of given ones if other arrays were empty.
*/
public static float[] join(final float[]... arrays)
{
if (arrays.length == 0)
{
return EMPTY_FLOATS;
}
if (arrays.length == 1)
{
return arrays[0];
}
if (arrays.length == 2)
{
return join(arrays[0], arrays[1]);
}
float[] notNull = null;
int finalSize = 0;
int nullArrays = 0;
final FloatArrayList list = new FloatArrayList(arrays.length * 10);
for (final float[] array : arrays)
{
if ((array == null) || (array.length == 0))
{
nullArrays++;
}
else
{
notNull = array;
finalSize += array.length;
list.addElements(list.size(), array);
}
}
if (nullArrays == arrays.length)
{
return EMPTY_FLOATS;
}
if (nullArrays == (arrays.length - 1))
{
return notNull;
}
return list.toArray(new float[list.size()]);
}
示例8: FloatColumn
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
public FloatColumn(String name) {
this(name, new FloatArrayList(DEFAULT_ARRAY_SIZE));
}
示例9: data
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
public FloatArrayList data() {
return data;
}
示例10: clear
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
@Override
public void clear() {
data = new FloatArrayList(DEFAULT_ARRAY_SIZE);
}
示例11: FloatAttributeStore
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
FloatAttributeStore(AttributeInfo attrInfo) {
super(attrInfo);
this.list = new FloatArrayList();
}
示例12: FloatToIdMap
import it.unimi.dsi.fastutil.floats.FloatArrayList; //导入依赖的package包/类
public FloatToIdMap() {
_valueToIdMap = new Float2IntOpenHashMap();
_valueToIdMap.defaultReturnValue(INVALID_KEY);
_idToValueMap = new FloatArrayList();
}